From 0fe4e34b9adb0c6aefb97a7f86255f17ef07a605 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 15 Sep 2024 02:50:29 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#35) --- .stats.yml | 2 +- api.md | 6 ++--- .../apps/users/collections/collections.ts | 2 +- .../apps/users/sessions/metamessages.ts | 7 +++--- src/resources/apps/users/sessions/sessions.ts | 22 +++++++++++-------- .../apps/users/sessions/sessions.test.ts | 8 +++---- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4bb711f..6d65821 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 38 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/plastic-labs%2Fhoncho-9b368f4c227f4695fb1b16d44996ca0dcaab52c7ee1433491ce2989fee846115.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/plastic-labs%2Fhoncho-522b2d21f11fa12f9f9bdc701a5c4ed2c2ee5ceee9d630d0c38fe5495aeae734.yml diff --git a/api.md b/api.md index 9f33ff1..7b6cfe3 100644 --- a/api.md +++ b/api.md @@ -44,9 +44,9 @@ Methods: - client.apps.users.sessions.update(appId, userId, sessionId, { ...params }) -> Session - client.apps.users.sessions.list(appId, userId, { ...params }) -> SessionsPage - client.apps.users.sessions.delete(appId, userId, sessionId) -> unknown -- client.apps.users.sessions.chat(appId, userId, sessionId, { ...params }) -> AgentChat +- client.apps.users.sessions.chat(appId, userId, sessionId, { ...params }) -> AgentChat - client.apps.users.sessions.get(appId, userId, sessionId) -> Session -- client.apps.users.sessions.stream(appId, userId, sessionId, { ...params }) -> unknown +- client.apps.users.sessions.stream(appId, userId, sessionId, { ...params }) -> unknown #### Messages @@ -93,7 +93,7 @@ Methods: - client.apps.users.collections.delete(appId, userId, collectionId) -> unknown - client.apps.users.collections.get(appId, userId, collectionId) -> Collection - client.apps.users.collections.getByName(appId, userId, name) -> Collection -- client.apps.users.collections.query(appId, userId, collectionId, { ...params }) -> CollectionQueryResponse +- client.apps.users.collections.query(appId, userId, collectionId, { ...params }) -> CollectionQueryResponse #### Documents diff --git a/src/resources/apps/users/collections/collections.ts b/src/resources/apps/users/collections/collections.ts index 35f1e3b..e896fc6 100644 --- a/src/resources/apps/users/collections/collections.ts +++ b/src/resources/apps/users/collections/collections.ts @@ -119,7 +119,7 @@ export class Collections extends APIResource { query: CollectionQueryParams, options?: Core.RequestOptions, ): Core.APIPromise { - return this._client.get(`/apps/${appId}/users/${userId}/collections/${collectionId}/query`, { + return this._client.get(`/apps/${appId}/users/${userId}/collections/${collectionId}/documents/query`, { query, ...options, }); diff --git a/src/resources/apps/users/sessions/metamessages.ts b/src/resources/apps/users/sessions/metamessages.ts index 156dd4e..bc9fdbf 100644 --- a/src/resources/apps/users/sessions/metamessages.ts +++ b/src/resources/apps/users/sessions/metamessages.ts @@ -8,13 +8,12 @@ import { Page, type PageParams } from '../../../../pagination'; export class Metamessages extends APIResource { /** - * Adds a metamessage to a session + * Adds a message to a session * * Args: app_id (uuid.UUID): The ID of the app representing the client application * using honcho user_id (str): The User ID representing the user, managed by the - * user session_id (int): The ID of the Session to add the metamessage to - * metamessage (schemas.MetamessageCreate): The Metamessage object to add - * containing the metamessage content and type + * user session_id (int): The ID of the Session to add the message to metamessage + * (schemas.MeteamessageCreate): The metamessage creation object * * Returns: schemas.Metamessage: The Metamessage object of the added metamessage * diff --git a/src/resources/apps/users/sessions/sessions.ts b/src/resources/apps/users/sessions/sessions.ts index f697aeb..0535a9c 100644 --- a/src/resources/apps/users/sessions/sessions.ts +++ b/src/resources/apps/users/sessions/sessions.ts @@ -103,17 +103,17 @@ export class Sessions extends APIResource { } /** - * Get Chat + * Chat */ chat( appId: string, userId: string, sessionId: string, - query: SessionChatParams, + body: SessionChatParams, options?: Core.RequestOptions, ): Core.APIPromise { - return this._client.get(`/apps/${appId}/users/${userId}/sessions/${sessionId}/chat`, { - query, + return this._client.post(`/apps/${appId}/users/${userId}/sessions/${sessionId}/chat`, { + body, ...options, }); } @@ -145,11 +145,11 @@ export class Sessions extends APIResource { appId: string, userId: string, sessionId: string, - query: SessionStreamParams, + body: SessionStreamParams, options?: Core.RequestOptions, ): Core.APIPromise { - return this._client.get(`/apps/${appId}/users/${userId}/sessions/${sessionId}/chat/stream`, { - query, + return this._client.post(`/apps/${appId}/users/${userId}/sessions/${sessionId}/chat/stream`, { + body, ...options, }); } @@ -206,11 +206,15 @@ export interface SessionListParams extends PageParams { } export interface SessionChatParams { - query: string; + queries: string | Array; + + collections?: string | Array; } export interface SessionStreamParams { - query: string; + queries: string | Array; + + collections?: string | Array; } export namespace Sessions { diff --git a/tests/api-resources/apps/users/sessions/sessions.test.ts b/tests/api-resources/apps/users/sessions/sessions.test.ts index 3d2ce39..465d21b 100644 --- a/tests/api-resources/apps/users/sessions/sessions.test.ts +++ b/tests/api-resources/apps/users/sessions/sessions.test.ts @@ -109,7 +109,7 @@ describe('resource sessions', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { query: 'query' }, + { queries: 'string' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -125,7 +125,7 @@ describe('resource sessions', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { query: 'query' }, + { queries: 'string', collections: 'string' }, ); }); @@ -161,7 +161,7 @@ describe('resource sessions', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { query: 'query' }, + { queries: 'string' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -177,7 +177,7 @@ describe('resource sessions', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { query: 'query' }, + { queries: 'string', collections: 'string' }, ); }); });