Class: WhopSDK::Resources::AIChats
- Inherits:
-
Object
- Object
- WhopSDK::Resources::AIChats
- Defined in:
- lib/whop_sdk/resources/ai_chats.rb,
sig/whop_sdk/resources/ai_chats.rbs
Instance Method Summary collapse
-
#create(message_text:, current_company_id: nil, message_attachments: nil, message_source: nil, suggestion_type: nil, title: nil, request_options: {}) ⇒ WhopSDK::Models::AIChat
Some parameter documentations has been truncated, see Models::AIChatCreateParams for more details.
-
#delete(id, request_options: {}) ⇒ Boolean
Delete an AI chat thread so it no longer appears in the user's chat list.
-
#initialize(client:) ⇒ AIChats
constructor
private
A new instance of AIChats.
-
#list(after: nil, before: nil, first: nil, last: nil, only_active_crons: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::AIChatListResponse>
Returns a paginated list of AI chat threads for the current authenticated user.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::AIChat
Retrieves the details of an existing AI chat.
-
#update(id, current_company_id: nil, notification_preference: nil, title: nil, request_options: {}) ⇒ WhopSDK::Models::AIChat
Some parameter documentations has been truncated, see Models::AIChatUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ AIChats
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of AIChats.
160 161 162 |
# File 'lib/whop_sdk/resources/ai_chats.rb', line 160 def initialize(client:) @client = client end |
Instance Method Details
#create(message_text:, current_company_id: nil, message_attachments: nil, message_source: nil, suggestion_type: nil, title: nil, request_options: {}) ⇒ WhopSDK::Models::AIChat
Some parameter documentations has been truncated, see Models::AIChatCreateParams for more details.
Create a new AI chat thread and send the first message to the AI agent.
Required permissions:
ai_chat:create
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/whop_sdk/resources/ai_chats.rb', line 34 def create(params) parsed, = WhopSDK::AIChatCreateParams.dump_request(params) @client.request( method: :post, path: "ai_chats", body: parsed, model: WhopSDK::AIChat, options: ) end |
#delete(id, request_options: {}) ⇒ Boolean
Delete an AI chat thread so it no longer appears in the user's chat list.
Required permissions:
ai_chat:delete
148 149 150 151 152 153 154 155 |
# File 'lib/whop_sdk/resources/ai_chats.rb', line 148 def delete(id, params = {}) @client.request( method: :delete, path: ["ai_chats/%1$s", id], model: WhopSDK::Internal::Type::Boolean, options: params[:request_options] ) end |
#list(after: nil, before: nil, first: nil, last: nil, only_active_crons: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::AIChatListResponse>
Returns a paginated list of AI chat threads for the current authenticated user.
120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/whop_sdk/resources/ai_chats.rb', line 120 def list(params = {}) parsed, = WhopSDK::AIChatListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "ai_chats", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::AIChatListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::AIChat
Retrieves the details of an existing AI chat.
56 57 58 59 60 61 62 63 |
# File 'lib/whop_sdk/resources/ai_chats.rb', line 56 def retrieve(id, params = {}) @client.request( method: :get, path: ["ai_chats/%1$s", id], model: WhopSDK::AIChat, options: params[:request_options] ) end |
#update(id, current_company_id: nil, notification_preference: nil, title: nil, request_options: {}) ⇒ WhopSDK::Models::AIChat
Some parameter documentations has been truncated, see Models::AIChatUpdateParams for more details.
Update an AI chat's title, notification preferences, or associated company context.
Required permissions:
ai_chat:update
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/whop_sdk/resources/ai_chats.rb', line 90 def update(id, params = {}) parsed, = WhopSDK::AIChatUpdateParams.dump_request(params) @client.request( method: :patch, path: ["ai_chats/%1$s", id], body: parsed, model: WhopSDK::AIChat, options: ) end |