liveblocks 3.15.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- liveblocks/__init__.py +12 -0
- liveblocks/api/__init__.py +1 -0
- liveblocks/api/ai/__init__.py +1 -0
- liveblocks/api/ai/create_ai_copilot.py +124 -0
- liveblocks/api/ai/create_file_knowledge_source.py +80 -0
- liveblocks/api/ai/create_web_knowledge_source.py +74 -0
- liveblocks/api/ai/delete_ai_copilot.py +58 -0
- liveblocks/api/ai/delete_file_knowledge_source.py +64 -0
- liveblocks/api/ai/delete_web_knowledge_source.py +64 -0
- liveblocks/api/ai/get_ai_copilot.py +100 -0
- liveblocks/api/ai/get_ai_copilots.py +74 -0
- liveblocks/api/ai/get_file_knowledge_source_markdown.py +67 -0
- liveblocks/api/ai/get_knowledge_source.py +84 -0
- liveblocks/api/ai/get_knowledge_sources.py +82 -0
- liveblocks/api/ai/get_web_knowledge_source_links.py +88 -0
- liveblocks/api/ai/update_ai_copilot.py +113 -0
- liveblocks/api/auth/__init__.py +1 -0
- liveblocks/api/auth/authorize_user.py +66 -0
- liveblocks/api/auth/identify_user.py +66 -0
- liveblocks/api/comments/__init__.py +1 -0
- liveblocks/api/comments/add_comment_reaction.py +86 -0
- liveblocks/api/comments/create_comment.py +80 -0
- liveblocks/api/comments/create_thread.py +74 -0
- liveblocks/api/comments/delete_comment.py +70 -0
- liveblocks/api/comments/delete_thread.py +64 -0
- liveblocks/api/comments/edit_comment.py +86 -0
- liveblocks/api/comments/edit_comment_metadata.py +86 -0
- liveblocks/api/comments/edit_thread_metadata.py +80 -0
- liveblocks/api/comments/get_comment.py +73 -0
- liveblocks/api/comments/get_thread.py +67 -0
- liveblocks/api/comments/get_thread_inbox_notifications.py +67 -0
- liveblocks/api/comments/get_thread_participants.py +0 -0
- liveblocks/api/comments/get_thread_subscriptions.py +67 -0
- liveblocks/api/comments/get_threads.py +75 -0
- liveblocks/api/comments/mark_thread_as_resolved.py +80 -0
- liveblocks/api/comments/mark_thread_as_unresolved.py +80 -0
- liveblocks/api/comments/remove_comment_reaction.py +85 -0
- liveblocks/api/comments/subscribe_to_thread.py +80 -0
- liveblocks/api/comments/unsubscribe_from_thread.py +77 -0
- liveblocks/api/groups/__init__.py +1 -0
- liveblocks/api/groups/add_group_members.py +74 -0
- liveblocks/api/groups/create_group.py +68 -0
- liveblocks/api/groups/delete_group.py +58 -0
- liveblocks/api/groups/get_group.py +61 -0
- liveblocks/api/groups/get_groups.py +74 -0
- liveblocks/api/groups/get_user_groups.py +82 -0
- liveblocks/api/groups/remove_group_members.py +74 -0
- liveblocks/api/management/__init__.py +1 -0
- liveblocks/api/management/activate_project_public_api_key.py +58 -0
- liveblocks/api/management/create_management_project.py +66 -0
- liveblocks/api/management/create_management_webhook.py +74 -0
- liveblocks/api/management/deactivate_project_public_api_key.py +58 -0
- liveblocks/api/management/delete_management_project.py +58 -0
- liveblocks/api/management/delete_management_webhook.py +64 -0
- liveblocks/api/management/delete_management_webhook_additional_headers.py +80 -0
- liveblocks/api/management/get_management_project.py +61 -0
- liveblocks/api/management/get_management_projects.py +74 -0
- liveblocks/api/management/get_management_webhook.py +67 -0
- liveblocks/api/management/get_management_webhook_additional_headers.py +67 -0
- liveblocks/api/management/get_management_webhooks.py +82 -0
- liveblocks/api/management/recover_failed_webhook_messages.py +79 -0
- liveblocks/api/management/roll_management_webhook_secret.py +67 -0
- liveblocks/api/management/roll_project_public_api_key.py +76 -0
- liveblocks/api/management/roll_project_secret_api_key.py +78 -0
- liveblocks/api/management/send_test_webhook.py +80 -0
- liveblocks/api/management/update_management_project.py +74 -0
- liveblocks/api/management/update_management_webhook.py +80 -0
- liveblocks/api/management/upsert_management_webhook_additional_headers.py +80 -0
- liveblocks/api/notifications/__init__.py +1 -0
- liveblocks/api/notifications/delete_all_inbox_notifications.py +58 -0
- liveblocks/api/notifications/delete_inbox_notification.py +64 -0
- liveblocks/api/notifications/delete_notification_settings.py +58 -0
- liveblocks/api/notifications/delete_room_notification_settings.py +0 -0
- liveblocks/api/notifications/delete_room_subscription_settings.py +64 -0
- liveblocks/api/notifications/get_inbox_notification.py +84 -0
- liveblocks/api/notifications/get_inbox_notifications.py +96 -0
- liveblocks/api/notifications/get_notification_settings.py +61 -0
- liveblocks/api/notifications/get_room_notification_settings.py +0 -0
- liveblocks/api/notifications/get_room_subscription_settings.py +67 -0
- liveblocks/api/notifications/get_user_room_subscription_settings.py +89 -0
- liveblocks/api/notifications/mark_inbox_notification_as_read.py +58 -0
- liveblocks/api/notifications/trigger_inbox_notification.py +65 -0
- liveblocks/api/notifications/update_notification_settings.py +74 -0
- liveblocks/api/notifications/update_room_notification_settings.py +0 -0
- liveblocks/api/notifications/update_room_subscription_settings.py +80 -0
- liveblocks/api/room/__init__.py +1 -0
- liveblocks/api/room/broadcast_event.py +70 -0
- liveblocks/api/room/create_room.py +79 -0
- liveblocks/api/room/delete_room.py +58 -0
- liveblocks/api/room/get_active_users.py +61 -0
- liveblocks/api/room/get_room.py +61 -0
- liveblocks/api/room/get_rooms.py +102 -0
- liveblocks/api/room/prewarm_room.py +58 -0
- liveblocks/api/room/set_presence.py +71 -0
- liveblocks/api/room/update_room.py +74 -0
- liveblocks/api/room/update_room_id.py +76 -0
- liveblocks/api/room/update_room_organization_id.py +76 -0
- liveblocks/api/room/upsert_room.py +74 -0
- liveblocks/api/storage/__init__.py +1 -0
- liveblocks/api/storage/delete_storage_document.py +58 -0
- liveblocks/api/storage/get_storage_document.py +80 -0
- liveblocks/api/storage/initialize_storage_document.py +76 -0
- liveblocks/api/storage/patch_storage_document.py +125 -0
- liveblocks/api/yjs/__init__.py +1 -0
- liveblocks/api/yjs/create_yjs_version.py +61 -0
- liveblocks/api/yjs/get_yjs_document.py +94 -0
- liveblocks/api/yjs/get_yjs_document_as_binary_update.py +75 -0
- liveblocks/api/yjs/get_yjs_version.py +68 -0
- liveblocks/api/yjs/get_yjs_versions.py +82 -0
- liveblocks/api/yjs/send_yjs_binary_update.py +83 -0
- liveblocks/client.py +7002 -0
- liveblocks/errors.py +52 -0
- liveblocks/models/__init__.py +397 -0
- liveblocks/models/active_users_response.py +76 -0
- liveblocks/models/active_users_response_data_item.py +96 -0
- liveblocks/models/active_users_response_data_item_info.py +45 -0
- liveblocks/models/add_comment_reaction_request_body.py +68 -0
- liveblocks/models/add_group_members_request_body.py +62 -0
- liveblocks/models/add_json_patch_operation.py +58 -0
- liveblocks/models/ai_copilot_anthropic.py +192 -0
- liveblocks/models/ai_copilot_base.py +154 -0
- liveblocks/models/ai_copilot_google.py +192 -0
- liveblocks/models/ai_copilot_open_ai.py +173 -0
- liveblocks/models/ai_copilot_open_ai_compatible.py +189 -0
- liveblocks/models/ai_copilot_provider_settings.py +117 -0
- liveblocks/models/anthropic_model.py +13 -0
- liveblocks/models/anthropic_provider_options.py +48 -0
- liveblocks/models/anthropic_provider_options_anthropic.py +120 -0
- liveblocks/models/anthropic_provider_options_anthropic_anthropic_thinking_disabled.py +42 -0
- liveblocks/models/anthropic_provider_options_anthropic_anthropic_thinking_enabled.py +50 -0
- liveblocks/models/anthropic_provider_options_anthropic_anthropic_web_search.py +61 -0
- liveblocks/models/authorization.py +62 -0
- liveblocks/models/authorize_user_request_body.py +87 -0
- liveblocks/models/authorize_user_request_body_permissions.py +52 -0
- liveblocks/models/authorize_user_request_body_user_info.py +45 -0
- liveblocks/models/authorize_user_response.py +43 -0
- liveblocks/models/comment.py +206 -0
- liveblocks/models/comment_attachment.py +77 -0
- liveblocks/models/comment_body.py +65 -0
- liveblocks/models/comment_body_content_item.py +45 -0
- liveblocks/models/comment_metadata.py +59 -0
- liveblocks/models/comment_reaction.py +58 -0
- liveblocks/models/copy_json_patch_operation.py +58 -0
- liveblocks/models/create_ai_copilot_options_anthropic.py +167 -0
- liveblocks/models/create_ai_copilot_options_base.py +110 -0
- liveblocks/models/create_ai_copilot_options_google.py +167 -0
- liveblocks/models/create_ai_copilot_options_open_ai.py +147 -0
- liveblocks/models/create_ai_copilot_options_open_ai_compatible.py +164 -0
- liveblocks/models/create_comment_request_body.py +104 -0
- liveblocks/models/create_file_knowledge_source_response.py +59 -0
- liveblocks/models/create_group_request_body.py +87 -0
- liveblocks/models/create_group_request_body_scopes.py +59 -0
- liveblocks/models/create_management_project_request_body.py +92 -0
- liveblocks/models/create_management_webhook_request_body.py +134 -0
- liveblocks/models/create_management_webhook_request_body_additional_headers.py +45 -0
- liveblocks/models/create_room_request_body.py +149 -0
- liveblocks/models/create_room_request_body_engine.py +9 -0
- liveblocks/models/create_thread_request_body.py +85 -0
- liveblocks/models/create_thread_request_body_comment.py +93 -0
- liveblocks/models/create_web_knowledge_source_request_body.py +80 -0
- liveblocks/models/create_web_knowledge_source_request_body_type.py +7 -0
- liveblocks/models/create_web_knowledge_source_response.py +43 -0
- liveblocks/models/create_yjs_version_response.py +48 -0
- liveblocks/models/create_yjs_version_response_data.py +40 -0
- liveblocks/models/delete_management_webhook_headers_request_body.py +43 -0
- liveblocks/models/delete_management_webhook_headers_response.py +48 -0
- liveblocks/models/edit_comment_metadata_request_body.py +73 -0
- liveblocks/models/edit_comment_metadata_request_body_metadata.py +58 -0
- liveblocks/models/edit_comment_request_body.py +96 -0
- liveblocks/models/edit_thread_metadata_request_body.py +92 -0
- liveblocks/models/edit_thread_metadata_request_body_metadata.py +58 -0
- liveblocks/models/error.py +86 -0
- liveblocks/models/get_ai_copilots_response.py +126 -0
- liveblocks/models/get_file_knowledge_source_markdown_response.py +51 -0
- liveblocks/models/get_groups_response.py +72 -0
- liveblocks/models/get_inbox_notifications_response.py +98 -0
- liveblocks/models/get_knowledge_sources_response.py +98 -0
- liveblocks/models/get_management_projects_response.py +82 -0
- liveblocks/models/get_management_webhook_headers_response.py +48 -0
- liveblocks/models/get_management_webhooks_response.py +81 -0
- liveblocks/models/get_room_subscription_settings_response.py +72 -0
- liveblocks/models/get_rooms_response.py +74 -0
- liveblocks/models/get_storage_document_format.py +6 -0
- liveblocks/models/get_storage_document_response.py +51 -0
- liveblocks/models/get_thread_inbox_notifications_response.py +78 -0
- liveblocks/models/get_thread_inbox_notifications_response_data_item.py +137 -0
- liveblocks/models/get_thread_participants_response.py +0 -0
- liveblocks/models/get_thread_subscriptions_response.py +57 -0
- liveblocks/models/get_threads_response.py +60 -0
- liveblocks/models/get_user_groups_response.py +72 -0
- liveblocks/models/get_web_knowledge_source_links_response.py +72 -0
- liveblocks/models/get_yjs_document_response.py +49 -0
- liveblocks/models/get_yjs_document_type.py +9 -0
- liveblocks/models/get_yjs_versions_response.py +72 -0
- liveblocks/models/google_model.py +9 -0
- liveblocks/models/google_provider_options.py +48 -0
- liveblocks/models/google_provider_options_google.py +71 -0
- liveblocks/models/google_provider_options_google_thinking_config.py +59 -0
- liveblocks/models/group.py +131 -0
- liveblocks/models/group_member.py +72 -0
- liveblocks/models/group_scopes.py +59 -0
- liveblocks/models/identify_user_request_body.py +87 -0
- liveblocks/models/identify_user_request_body_user_info.py +45 -0
- liveblocks/models/identify_user_response.py +43 -0
- liveblocks/models/inbox_notification_activity.py +66 -0
- liveblocks/models/inbox_notification_activity_data.py +56 -0
- liveblocks/models/inbox_notification_custom_data.py +141 -0
- liveblocks/models/inbox_notification_thread_data.py +133 -0
- liveblocks/models/initialize_storage_document_body.py +82 -0
- liveblocks/models/initialize_storage_document_body_data.py +45 -0
- liveblocks/models/initialize_storage_document_response.py +86 -0
- liveblocks/models/initialize_storage_document_response_data.py +45 -0
- liveblocks/models/knowledge_source_base.py +90 -0
- liveblocks/models/knowledge_source_base_status.py +7 -0
- liveblocks/models/knowledge_source_file_source.py +133 -0
- liveblocks/models/knowledge_source_file_source_file.py +67 -0
- liveblocks/models/knowledge_source_web_source.py +114 -0
- liveblocks/models/knowledge_source_web_source_link.py +69 -0
- liveblocks/models/knowledge_source_web_source_link_type.py +7 -0
- liveblocks/models/management_project.py +173 -0
- liveblocks/models/management_project_public_key.py +80 -0
- liveblocks/models/management_project_region.py +7 -0
- liveblocks/models/management_project_roll_project_secret_api_key_response_secret_key_response.py +49 -0
- liveblocks/models/management_project_secret_key.py +72 -0
- liveblocks/models/management_project_type.py +6 -0
- liveblocks/models/management_webhook.py +173 -0
- liveblocks/models/management_webhook_additional_headers.py +49 -0
- liveblocks/models/management_webhook_event.py +22 -0
- liveblocks/models/management_webhook_headers_delete.py +62 -0
- liveblocks/models/management_webhook_secret.py +62 -0
- liveblocks/models/mark_thread_as_resolved_request_body.py +43 -0
- liveblocks/models/mark_thread_as_unresolved_request_body.py +43 -0
- liveblocks/models/move_json_patch_operation.py +58 -0
- liveblocks/models/notification_channel_settings.py +71 -0
- liveblocks/models/notification_settings.py +110 -0
- liveblocks/models/open_ai_model.py +23 -0
- liveblocks/models/open_ai_provider_options.py +48 -0
- liveblocks/models/open_ai_provider_options_openai.py +69 -0
- liveblocks/models/open_ai_provider_options_openai_reasoning_effort.py +7 -0
- liveblocks/models/open_ai_provider_options_openai_web_search.py +42 -0
- liveblocks/models/recover_management_webhook_failed_messages_request_body.py +45 -0
- liveblocks/models/remove_comment_reaction_request_body.py +68 -0
- liveblocks/models/remove_group_members_request_body.py +62 -0
- liveblocks/models/remove_json_patch_operation.py +50 -0
- liveblocks/models/replace_json_patch_operation.py +79 -0
- liveblocks/models/roll_project_public_api_key_request_body.py +56 -0
- liveblocks/models/roll_project_public_api_key_request_body_expiration_in.py +17 -0
- liveblocks/models/roll_project_public_api_key_response.py +49 -0
- liveblocks/models/roll_project_secret_api_key_request_body.py +56 -0
- liveblocks/models/roll_project_secret_api_key_request_body_expiration_in.py +17 -0
- liveblocks/models/room.py +140 -0
- liveblocks/models/room_accesses.py +66 -0
- liveblocks/models/room_accesses_additional_property_item.py +8 -0
- liveblocks/models/room_metadata.py +72 -0
- liveblocks/models/room_permission_item.py +8 -0
- liveblocks/models/room_subscription_settings.py +54 -0
- liveblocks/models/room_subscription_settings_text_mentions.py +6 -0
- liveblocks/models/room_subscription_settings_threads.py +7 -0
- liveblocks/models/room_type.py +5 -0
- liveblocks/models/rotate_management_webhook_secret_response.py +75 -0
- liveblocks/models/set_presence_request_body.py +87 -0
- liveblocks/models/set_presence_request_body_data.py +45 -0
- liveblocks/models/set_presence_request_body_user_info.py +78 -0
- liveblocks/models/subscribe_to_thread_request_body.py +43 -0
- liveblocks/models/subscription.py +61 -0
- liveblocks/models/test_json_patch_operation.py +58 -0
- liveblocks/models/test_management_webhook_request_body.py +64 -0
- liveblocks/models/test_management_webhook_response.py +48 -0
- liveblocks/models/test_management_webhook_response_message.py +74 -0
- liveblocks/models/thread.py +142 -0
- liveblocks/models/thread_metadata.py +59 -0
- liveblocks/models/trigger_inbox_notification_request_body.py +115 -0
- liveblocks/models/trigger_inbox_notification_request_body_activity_data.py +56 -0
- liveblocks/models/unsubscribe_from_thread_request_body.py +43 -0
- liveblocks/models/update_ai_copilot_request_body.py +253 -0
- liveblocks/models/update_ai_copilot_request_body_provider.py +8 -0
- liveblocks/models/update_management_project_request_body.py +80 -0
- liveblocks/models/update_management_webhook_request_body.py +121 -0
- liveblocks/models/update_notification_settings_request_body.py +108 -0
- liveblocks/models/update_room_id_request_body.py +43 -0
- liveblocks/models/update_room_organization_id_request_body.py +52 -0
- liveblocks/models/update_room_request_body.py +139 -0
- liveblocks/models/update_room_request_body_groups_accesses.py +95 -0
- liveblocks/models/update_room_request_body_groups_accesses_additional_property_type_0_item.py +8 -0
- liveblocks/models/update_room_request_body_metadata.py +70 -0
- liveblocks/models/update_room_request_body_users_accesses.py +93 -0
- liveblocks/models/update_room_request_body_users_accesses_additional_property_type_0_item.py +8 -0
- liveblocks/models/update_room_subscription_settings_request_body.py +73 -0
- liveblocks/models/update_room_subscription_settings_request_body_text_mentions.py +6 -0
- liveblocks/models/update_room_subscription_settings_request_body_threads.py +7 -0
- liveblocks/models/upsert_management_webhook_headers_request_body.py +48 -0
- liveblocks/models/upsert_management_webhook_headers_response.py +52 -0
- liveblocks/models/upsert_management_webhook_headers_response_headers.py +45 -0
- liveblocks/models/upsert_room_request_body.py +72 -0
- liveblocks/models/user_room_subscription_settings.py +62 -0
- liveblocks/models/user_room_subscription_settings_text_mentions.py +6 -0
- liveblocks/models/user_room_subscription_settings_threads.py +7 -0
- liveblocks/models/user_subscription.py +91 -0
- liveblocks/models/web_knowledge_source_link.py +80 -0
- liveblocks/models/web_knowledge_source_link_status.py +7 -0
- liveblocks/models/yjs_version.py +121 -0
- liveblocks/models/yjs_version_authors_item.py +59 -0
- liveblocks/py.typed +1 -0
- liveblocks/session.py +189 -0
- liveblocks/types.py +39 -0
- liveblocks/webhooks.py +525 -0
- liveblocks-3.15.3.dist-info/METADATA +2593 -0
- liveblocks-3.15.3.dist-info/RECORD +309 -0
- liveblocks-3.15.3.dist-info/WHEEL +4 -0
liveblocks/__init__.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""A client library for accessing Liveblocks API"""
|
|
2
|
+
|
|
3
|
+
from .client import AsyncLiveblocks, Liveblocks
|
|
4
|
+
from .errors import LiveblocksError
|
|
5
|
+
from .webhooks import WebhookHandler
|
|
6
|
+
|
|
7
|
+
__all__ = (
|
|
8
|
+
"AsyncLiveblocks",
|
|
9
|
+
"Liveblocks",
|
|
10
|
+
"LiveblocksError",
|
|
11
|
+
"WebhookHandler",
|
|
12
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains methods for accessing the API"""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
|
|
5
|
+
from ... import errors
|
|
6
|
+
from ...models.ai_copilot_anthropic import AiCopilotAnthropic
|
|
7
|
+
from ...models.ai_copilot_google import AiCopilotGoogle
|
|
8
|
+
from ...models.ai_copilot_open_ai import AiCopilotOpenAi
|
|
9
|
+
from ...models.ai_copilot_open_ai_compatible import AiCopilotOpenAiCompatible
|
|
10
|
+
from ...models.create_ai_copilot_options_anthropic import CreateAiCopilotOptionsAnthropic
|
|
11
|
+
from ...models.create_ai_copilot_options_google import CreateAiCopilotOptionsGoogle
|
|
12
|
+
from ...models.create_ai_copilot_options_open_ai import CreateAiCopilotOptionsOpenAi
|
|
13
|
+
from ...models.create_ai_copilot_options_open_ai_compatible import CreateAiCopilotOptionsOpenAiCompatible
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
*,
|
|
18
|
+
body: CreateAiCopilotOptionsAnthropic
|
|
19
|
+
| CreateAiCopilotOptionsGoogle
|
|
20
|
+
| CreateAiCopilotOptionsOpenAi
|
|
21
|
+
| CreateAiCopilotOptionsOpenAiCompatible,
|
|
22
|
+
) -> dict[str, Any]:
|
|
23
|
+
headers: dict[str, Any] = {}
|
|
24
|
+
|
|
25
|
+
_kwargs: dict[str, Any] = {
|
|
26
|
+
"method": "post",
|
|
27
|
+
"url": "/v2/ai/copilots",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if isinstance(body, CreateAiCopilotOptionsOpenAi):
|
|
31
|
+
_kwargs["json"] = body.to_dict()
|
|
32
|
+
elif isinstance(body, CreateAiCopilotOptionsAnthropic):
|
|
33
|
+
_kwargs["json"] = body.to_dict()
|
|
34
|
+
elif isinstance(body, CreateAiCopilotOptionsGoogle):
|
|
35
|
+
_kwargs["json"] = body.to_dict()
|
|
36
|
+
else:
|
|
37
|
+
_kwargs["json"] = body.to_dict()
|
|
38
|
+
|
|
39
|
+
headers["Content-Type"] = "application/json"
|
|
40
|
+
|
|
41
|
+
_kwargs["headers"] = headers
|
|
42
|
+
return _kwargs
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _parse_response(
|
|
46
|
+
*, response: httpx.Response
|
|
47
|
+
) -> AiCopilotAnthropic | AiCopilotGoogle | AiCopilotOpenAi | AiCopilotOpenAiCompatible:
|
|
48
|
+
if response.status_code == 201:
|
|
49
|
+
|
|
50
|
+
def _parse_response_201(
|
|
51
|
+
data: object,
|
|
52
|
+
) -> AiCopilotAnthropic | AiCopilotGoogle | AiCopilotOpenAi | AiCopilotOpenAiCompatible:
|
|
53
|
+
try:
|
|
54
|
+
if not isinstance(data, dict):
|
|
55
|
+
raise TypeError()
|
|
56
|
+
componentsschemas_ai_copilot_type_0 = AiCopilotOpenAi.from_dict(data)
|
|
57
|
+
|
|
58
|
+
return componentsschemas_ai_copilot_type_0
|
|
59
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
60
|
+
pass
|
|
61
|
+
try:
|
|
62
|
+
if not isinstance(data, dict):
|
|
63
|
+
raise TypeError()
|
|
64
|
+
componentsschemas_ai_copilot_type_1 = AiCopilotAnthropic.from_dict(data)
|
|
65
|
+
|
|
66
|
+
return componentsschemas_ai_copilot_type_1
|
|
67
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
68
|
+
pass
|
|
69
|
+
try:
|
|
70
|
+
if not isinstance(data, dict):
|
|
71
|
+
raise TypeError()
|
|
72
|
+
componentsschemas_ai_copilot_type_2 = AiCopilotGoogle.from_dict(data)
|
|
73
|
+
|
|
74
|
+
return componentsschemas_ai_copilot_type_2
|
|
75
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
76
|
+
pass
|
|
77
|
+
if not isinstance(data, dict):
|
|
78
|
+
raise TypeError()
|
|
79
|
+
componentsschemas_ai_copilot_type_3 = AiCopilotOpenAiCompatible.from_dict(data)
|
|
80
|
+
|
|
81
|
+
return componentsschemas_ai_copilot_type_3
|
|
82
|
+
|
|
83
|
+
response_201 = _parse_response_201(response.json())
|
|
84
|
+
|
|
85
|
+
return response_201
|
|
86
|
+
|
|
87
|
+
raise errors.LiveblocksError.from_response(response)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _sync(
|
|
91
|
+
*,
|
|
92
|
+
client: httpx.Client,
|
|
93
|
+
body: CreateAiCopilotOptionsAnthropic
|
|
94
|
+
| CreateAiCopilotOptionsGoogle
|
|
95
|
+
| CreateAiCopilotOptionsOpenAi
|
|
96
|
+
| CreateAiCopilotOptionsOpenAiCompatible,
|
|
97
|
+
) -> AiCopilotAnthropic | AiCopilotGoogle | AiCopilotOpenAi | AiCopilotOpenAiCompatible:
|
|
98
|
+
kwargs = _get_kwargs(
|
|
99
|
+
body=body,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
response = client.request(
|
|
103
|
+
**kwargs,
|
|
104
|
+
)
|
|
105
|
+
return _parse_response(response=response)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
async def _asyncio(
|
|
109
|
+
*,
|
|
110
|
+
client: httpx.AsyncClient,
|
|
111
|
+
body: CreateAiCopilotOptionsAnthropic
|
|
112
|
+
| CreateAiCopilotOptionsGoogle
|
|
113
|
+
| CreateAiCopilotOptionsOpenAi
|
|
114
|
+
| CreateAiCopilotOptionsOpenAiCompatible,
|
|
115
|
+
) -> AiCopilotAnthropic | AiCopilotGoogle | AiCopilotOpenAi | AiCopilotOpenAiCompatible:
|
|
116
|
+
kwargs = _get_kwargs(
|
|
117
|
+
body=body,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
response = await client.request(
|
|
121
|
+
**kwargs,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
return _parse_response(response=response)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...models.create_file_knowledge_source_response import CreateFileKnowledgeSourceResponse
|
|
8
|
+
from ...types import File
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _get_kwargs(
|
|
12
|
+
copilot_id: str,
|
|
13
|
+
name: str,
|
|
14
|
+
*,
|
|
15
|
+
body: File,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
headers: dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "put",
|
|
21
|
+
"url": "/v2/ai/copilots/{copilot_id}/knowledge/file/{name}".format(
|
|
22
|
+
copilot_id=quote(str(copilot_id), safe=""),
|
|
23
|
+
name=quote(str(name), safe=""),
|
|
24
|
+
),
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
_kwargs["content"] = body.payload
|
|
28
|
+
|
|
29
|
+
headers["Content-Type"] = "application/octet-stream"
|
|
30
|
+
|
|
31
|
+
_kwargs["headers"] = headers
|
|
32
|
+
return _kwargs
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _parse_response(*, response: httpx.Response) -> CreateFileKnowledgeSourceResponse:
|
|
36
|
+
if response.status_code == 200:
|
|
37
|
+
response_200 = CreateFileKnowledgeSourceResponse.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_200
|
|
40
|
+
|
|
41
|
+
raise errors.LiveblocksError.from_response(response)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _sync(
|
|
45
|
+
copilot_id: str,
|
|
46
|
+
name: str,
|
|
47
|
+
*,
|
|
48
|
+
client: httpx.Client,
|
|
49
|
+
body: File,
|
|
50
|
+
) -> CreateFileKnowledgeSourceResponse:
|
|
51
|
+
kwargs = _get_kwargs(
|
|
52
|
+
copilot_id=copilot_id,
|
|
53
|
+
name=name,
|
|
54
|
+
body=body,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
response = client.request(
|
|
58
|
+
**kwargs,
|
|
59
|
+
)
|
|
60
|
+
return _parse_response(response=response)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
async def _asyncio(
|
|
64
|
+
copilot_id: str,
|
|
65
|
+
name: str,
|
|
66
|
+
*,
|
|
67
|
+
client: httpx.AsyncClient,
|
|
68
|
+
body: File,
|
|
69
|
+
) -> CreateFileKnowledgeSourceResponse:
|
|
70
|
+
kwargs = _get_kwargs(
|
|
71
|
+
copilot_id=copilot_id,
|
|
72
|
+
name=name,
|
|
73
|
+
body=body,
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
response = await client.request(
|
|
77
|
+
**kwargs,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return _parse_response(response=response)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...models.create_web_knowledge_source_request_body import CreateWebKnowledgeSourceRequestBody
|
|
8
|
+
from ...models.create_web_knowledge_source_response import CreateWebKnowledgeSourceResponse
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _get_kwargs(
|
|
12
|
+
copilot_id: str,
|
|
13
|
+
*,
|
|
14
|
+
body: CreateWebKnowledgeSourceRequestBody,
|
|
15
|
+
) -> dict[str, Any]:
|
|
16
|
+
headers: dict[str, Any] = {}
|
|
17
|
+
|
|
18
|
+
_kwargs: dict[str, Any] = {
|
|
19
|
+
"method": "post",
|
|
20
|
+
"url": "/v2/ai/copilots/{copilot_id}/knowledge/web".format(
|
|
21
|
+
copilot_id=quote(str(copilot_id), safe=""),
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_kwargs["json"] = body.to_dict()
|
|
26
|
+
|
|
27
|
+
headers["Content-Type"] = "application/json"
|
|
28
|
+
|
|
29
|
+
_kwargs["headers"] = headers
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(*, response: httpx.Response) -> CreateWebKnowledgeSourceResponse:
|
|
34
|
+
if response.status_code == 200:
|
|
35
|
+
response_200 = CreateWebKnowledgeSourceResponse.from_dict(response.json())
|
|
36
|
+
|
|
37
|
+
return response_200
|
|
38
|
+
|
|
39
|
+
raise errors.LiveblocksError.from_response(response)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _sync(
|
|
43
|
+
copilot_id: str,
|
|
44
|
+
*,
|
|
45
|
+
client: httpx.Client,
|
|
46
|
+
body: CreateWebKnowledgeSourceRequestBody,
|
|
47
|
+
) -> CreateWebKnowledgeSourceResponse:
|
|
48
|
+
kwargs = _get_kwargs(
|
|
49
|
+
copilot_id=copilot_id,
|
|
50
|
+
body=body,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
response = client.request(
|
|
54
|
+
**kwargs,
|
|
55
|
+
)
|
|
56
|
+
return _parse_response(response=response)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
async def _asyncio(
|
|
60
|
+
copilot_id: str,
|
|
61
|
+
*,
|
|
62
|
+
client: httpx.AsyncClient,
|
|
63
|
+
body: CreateWebKnowledgeSourceRequestBody,
|
|
64
|
+
) -> CreateWebKnowledgeSourceResponse:
|
|
65
|
+
kwargs = _get_kwargs(
|
|
66
|
+
copilot_id=copilot_id,
|
|
67
|
+
body=body,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
response = await client.request(
|
|
71
|
+
**kwargs,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
return _parse_response(response=response)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _get_kwargs(
|
|
10
|
+
copilot_id: str,
|
|
11
|
+
) -> dict[str, Any]:
|
|
12
|
+
|
|
13
|
+
_kwargs: dict[str, Any] = {
|
|
14
|
+
"method": "delete",
|
|
15
|
+
"url": "/v2/ai/copilots/{copilot_id}".format(
|
|
16
|
+
copilot_id=quote(str(copilot_id), safe=""),
|
|
17
|
+
),
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return _kwargs
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _parse_response(*, response: httpx.Response) -> None:
|
|
24
|
+
if response.status_code == 204:
|
|
25
|
+
return None
|
|
26
|
+
|
|
27
|
+
raise errors.LiveblocksError.from_response(response)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _sync(
|
|
31
|
+
copilot_id: str,
|
|
32
|
+
*,
|
|
33
|
+
client: httpx.Client,
|
|
34
|
+
) -> None:
|
|
35
|
+
kwargs = _get_kwargs(
|
|
36
|
+
copilot_id=copilot_id,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
response = client.request(
|
|
40
|
+
**kwargs,
|
|
41
|
+
)
|
|
42
|
+
return _parse_response(response=response)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
async def _asyncio(
|
|
46
|
+
copilot_id: str,
|
|
47
|
+
*,
|
|
48
|
+
client: httpx.AsyncClient,
|
|
49
|
+
) -> None:
|
|
50
|
+
kwargs = _get_kwargs(
|
|
51
|
+
copilot_id=copilot_id,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
response = await client.request(
|
|
55
|
+
**kwargs,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
return _parse_response(response=response)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _get_kwargs(
|
|
10
|
+
copilot_id: str,
|
|
11
|
+
knowledge_source_id: str,
|
|
12
|
+
) -> dict[str, Any]:
|
|
13
|
+
|
|
14
|
+
_kwargs: dict[str, Any] = {
|
|
15
|
+
"method": "delete",
|
|
16
|
+
"url": "/v2/ai/copilots/{copilot_id}/knowledge/file/{knowledge_source_id}".format(
|
|
17
|
+
copilot_id=quote(str(copilot_id), safe=""),
|
|
18
|
+
knowledge_source_id=quote(str(knowledge_source_id), safe=""),
|
|
19
|
+
),
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return _kwargs
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _parse_response(*, response: httpx.Response) -> None:
|
|
26
|
+
if response.status_code == 204:
|
|
27
|
+
return None
|
|
28
|
+
|
|
29
|
+
raise errors.LiveblocksError.from_response(response)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _sync(
|
|
33
|
+
copilot_id: str,
|
|
34
|
+
knowledge_source_id: str,
|
|
35
|
+
*,
|
|
36
|
+
client: httpx.Client,
|
|
37
|
+
) -> None:
|
|
38
|
+
kwargs = _get_kwargs(
|
|
39
|
+
copilot_id=copilot_id,
|
|
40
|
+
knowledge_source_id=knowledge_source_id,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
response = client.request(
|
|
44
|
+
**kwargs,
|
|
45
|
+
)
|
|
46
|
+
return _parse_response(response=response)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
async def _asyncio(
|
|
50
|
+
copilot_id: str,
|
|
51
|
+
knowledge_source_id: str,
|
|
52
|
+
*,
|
|
53
|
+
client: httpx.AsyncClient,
|
|
54
|
+
) -> None:
|
|
55
|
+
kwargs = _get_kwargs(
|
|
56
|
+
copilot_id=copilot_id,
|
|
57
|
+
knowledge_source_id=knowledge_source_id,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
response = await client.request(
|
|
61
|
+
**kwargs,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
return _parse_response(response=response)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _get_kwargs(
|
|
10
|
+
copilot_id: str,
|
|
11
|
+
knowledge_source_id: str,
|
|
12
|
+
) -> dict[str, Any]:
|
|
13
|
+
|
|
14
|
+
_kwargs: dict[str, Any] = {
|
|
15
|
+
"method": "delete",
|
|
16
|
+
"url": "/v2/ai/copilots/{copilot_id}/knowledge/web/{knowledge_source_id}".format(
|
|
17
|
+
copilot_id=quote(str(copilot_id), safe=""),
|
|
18
|
+
knowledge_source_id=quote(str(knowledge_source_id), safe=""),
|
|
19
|
+
),
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return _kwargs
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _parse_response(*, response: httpx.Response) -> None:
|
|
26
|
+
if response.status_code == 204:
|
|
27
|
+
return None
|
|
28
|
+
|
|
29
|
+
raise errors.LiveblocksError.from_response(response)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _sync(
|
|
33
|
+
copilot_id: str,
|
|
34
|
+
knowledge_source_id: str,
|
|
35
|
+
*,
|
|
36
|
+
client: httpx.Client,
|
|
37
|
+
) -> None:
|
|
38
|
+
kwargs = _get_kwargs(
|
|
39
|
+
copilot_id=copilot_id,
|
|
40
|
+
knowledge_source_id=knowledge_source_id,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
response = client.request(
|
|
44
|
+
**kwargs,
|
|
45
|
+
)
|
|
46
|
+
return _parse_response(response=response)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
async def _asyncio(
|
|
50
|
+
copilot_id: str,
|
|
51
|
+
knowledge_source_id: str,
|
|
52
|
+
*,
|
|
53
|
+
client: httpx.AsyncClient,
|
|
54
|
+
) -> None:
|
|
55
|
+
kwargs = _get_kwargs(
|
|
56
|
+
copilot_id=copilot_id,
|
|
57
|
+
knowledge_source_id=knowledge_source_id,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
response = await client.request(
|
|
61
|
+
**kwargs,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
return _parse_response(response=response)
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...models.ai_copilot_anthropic import AiCopilotAnthropic
|
|
8
|
+
from ...models.ai_copilot_google import AiCopilotGoogle
|
|
9
|
+
from ...models.ai_copilot_open_ai import AiCopilotOpenAi
|
|
10
|
+
from ...models.ai_copilot_open_ai_compatible import AiCopilotOpenAiCompatible
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
copilot_id: str,
|
|
15
|
+
) -> dict[str, Any]:
|
|
16
|
+
|
|
17
|
+
_kwargs: dict[str, Any] = {
|
|
18
|
+
"method": "get",
|
|
19
|
+
"url": "/v2/ai/copilots/{copilot_id}".format(
|
|
20
|
+
copilot_id=quote(str(copilot_id), safe=""),
|
|
21
|
+
),
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return _kwargs
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _parse_response(
|
|
28
|
+
*, response: httpx.Response
|
|
29
|
+
) -> AiCopilotAnthropic | AiCopilotGoogle | AiCopilotOpenAi | AiCopilotOpenAiCompatible:
|
|
30
|
+
if response.status_code == 200:
|
|
31
|
+
|
|
32
|
+
def _parse_response_200(
|
|
33
|
+
data: object,
|
|
34
|
+
) -> AiCopilotAnthropic | AiCopilotGoogle | AiCopilotOpenAi | AiCopilotOpenAiCompatible:
|
|
35
|
+
try:
|
|
36
|
+
if not isinstance(data, dict):
|
|
37
|
+
raise TypeError()
|
|
38
|
+
componentsschemas_ai_copilot_type_0 = AiCopilotOpenAi.from_dict(data)
|
|
39
|
+
|
|
40
|
+
return componentsschemas_ai_copilot_type_0
|
|
41
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
42
|
+
pass
|
|
43
|
+
try:
|
|
44
|
+
if not isinstance(data, dict):
|
|
45
|
+
raise TypeError()
|
|
46
|
+
componentsschemas_ai_copilot_type_1 = AiCopilotAnthropic.from_dict(data)
|
|
47
|
+
|
|
48
|
+
return componentsschemas_ai_copilot_type_1
|
|
49
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
50
|
+
pass
|
|
51
|
+
try:
|
|
52
|
+
if not isinstance(data, dict):
|
|
53
|
+
raise TypeError()
|
|
54
|
+
componentsschemas_ai_copilot_type_2 = AiCopilotGoogle.from_dict(data)
|
|
55
|
+
|
|
56
|
+
return componentsschemas_ai_copilot_type_2
|
|
57
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
58
|
+
pass
|
|
59
|
+
if not isinstance(data, dict):
|
|
60
|
+
raise TypeError()
|
|
61
|
+
componentsschemas_ai_copilot_type_3 = AiCopilotOpenAiCompatible.from_dict(data)
|
|
62
|
+
|
|
63
|
+
return componentsschemas_ai_copilot_type_3
|
|
64
|
+
|
|
65
|
+
response_200 = _parse_response_200(response.json())
|
|
66
|
+
|
|
67
|
+
return response_200
|
|
68
|
+
|
|
69
|
+
raise errors.LiveblocksError.from_response(response)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _sync(
|
|
73
|
+
copilot_id: str,
|
|
74
|
+
*,
|
|
75
|
+
client: httpx.Client,
|
|
76
|
+
) -> AiCopilotAnthropic | AiCopilotGoogle | AiCopilotOpenAi | AiCopilotOpenAiCompatible:
|
|
77
|
+
kwargs = _get_kwargs(
|
|
78
|
+
copilot_id=copilot_id,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
response = client.request(
|
|
82
|
+
**kwargs,
|
|
83
|
+
)
|
|
84
|
+
return _parse_response(response=response)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
async def _asyncio(
|
|
88
|
+
copilot_id: str,
|
|
89
|
+
*,
|
|
90
|
+
client: httpx.AsyncClient,
|
|
91
|
+
) -> AiCopilotAnthropic | AiCopilotGoogle | AiCopilotOpenAi | AiCopilotOpenAiCompatible:
|
|
92
|
+
kwargs = _get_kwargs(
|
|
93
|
+
copilot_id=copilot_id,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
response = await client.request(
|
|
97
|
+
**kwargs,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
return _parse_response(response=response)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
|
|
5
|
+
from ... import errors
|
|
6
|
+
from ...models.get_ai_copilots_response import GetAiCopilotsResponse
|
|
7
|
+
from ...types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _get_kwargs(
|
|
11
|
+
*,
|
|
12
|
+
limit: int | Unset = 20,
|
|
13
|
+
starting_after: str | Unset = UNSET,
|
|
14
|
+
) -> dict[str, Any]:
|
|
15
|
+
|
|
16
|
+
params: dict[str, Any] = {}
|
|
17
|
+
|
|
18
|
+
params["limit"] = limit
|
|
19
|
+
|
|
20
|
+
params["startingAfter"] = starting_after
|
|
21
|
+
|
|
22
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
23
|
+
|
|
24
|
+
_kwargs: dict[str, Any] = {
|
|
25
|
+
"method": "get",
|
|
26
|
+
"url": "/v2/ai/copilots",
|
|
27
|
+
"params": params,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(*, response: httpx.Response) -> GetAiCopilotsResponse:
|
|
34
|
+
if response.status_code == 200:
|
|
35
|
+
response_200 = GetAiCopilotsResponse.from_dict(response.json())
|
|
36
|
+
|
|
37
|
+
return response_200
|
|
38
|
+
|
|
39
|
+
raise errors.LiveblocksError.from_response(response)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _sync(
|
|
43
|
+
*,
|
|
44
|
+
client: httpx.Client,
|
|
45
|
+
limit: int | Unset = 20,
|
|
46
|
+
starting_after: str | Unset = UNSET,
|
|
47
|
+
) -> GetAiCopilotsResponse:
|
|
48
|
+
kwargs = _get_kwargs(
|
|
49
|
+
limit=limit,
|
|
50
|
+
starting_after=starting_after,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
response = client.request(
|
|
54
|
+
**kwargs,
|
|
55
|
+
)
|
|
56
|
+
return _parse_response(response=response)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
async def _asyncio(
|
|
60
|
+
*,
|
|
61
|
+
client: httpx.AsyncClient,
|
|
62
|
+
limit: int | Unset = 20,
|
|
63
|
+
starting_after: str | Unset = UNSET,
|
|
64
|
+
) -> GetAiCopilotsResponse:
|
|
65
|
+
kwargs = _get_kwargs(
|
|
66
|
+
limit=limit,
|
|
67
|
+
starting_after=starting_after,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
response = await client.request(
|
|
71
|
+
**kwargs,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
return _parse_response(response=response)
|