Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Sep 15, 2024
1 parent 9d50dfc commit 0fe4e34
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Methods:
- <code title="put /apps/{app_id}/users/{user_id}/sessions/{session_id}">client.apps.users.sessions.<a href="./src/resources/apps/users/sessions/sessions.ts">update</a>(appId, userId, sessionId, { ...params }) -> Session</code>
- <code title="get /apps/{app_id}/users/{user_id}/sessions">client.apps.users.sessions.<a href="./src/resources/apps/users/sessions/sessions.ts">list</a>(appId, userId, { ...params }) -> SessionsPage</code>
- <code title="delete /apps/{app_id}/users/{user_id}/sessions/{session_id}">client.apps.users.sessions.<a href="./src/resources/apps/users/sessions/sessions.ts">delete</a>(appId, userId, sessionId) -> unknown</code>
- <code title="get /apps/{app_id}/users/{user_id}/sessions/{session_id}/chat">client.apps.users.sessions.<a href="./src/resources/apps/users/sessions/sessions.ts">chat</a>(appId, userId, sessionId, { ...params }) -> AgentChat</code>
- <code title="post /apps/{app_id}/users/{user_id}/sessions/{session_id}/chat">client.apps.users.sessions.<a href="./src/resources/apps/users/sessions/sessions.ts">chat</a>(appId, userId, sessionId, { ...params }) -> AgentChat</code>
- <code title="get /apps/{app_id}/users/{user_id}/sessions/{session_id}">client.apps.users.sessions.<a href="./src/resources/apps/users/sessions/sessions.ts">get</a>(appId, userId, sessionId) -> Session</code>
- <code title="get /apps/{app_id}/users/{user_id}/sessions/{session_id}/chat/stream">client.apps.users.sessions.<a href="./src/resources/apps/users/sessions/sessions.ts">stream</a>(appId, userId, sessionId, { ...params }) -> unknown</code>
- <code title="post /apps/{app_id}/users/{user_id}/sessions/{session_id}/chat/stream">client.apps.users.sessions.<a href="./src/resources/apps/users/sessions/sessions.ts">stream</a>(appId, userId, sessionId, { ...params }) -> unknown</code>

#### Messages

Expand Down Expand Up @@ -93,7 +93,7 @@ Methods:
- <code title="delete /apps/{app_id}/users/{user_id}/collections/{collection_id}">client.apps.users.collections.<a href="./src/resources/apps/users/collections/collections.ts">delete</a>(appId, userId, collectionId) -> unknown</code>
- <code title="get /apps/{app_id}/users/{user_id}/collections/{collection_id}">client.apps.users.collections.<a href="./src/resources/apps/users/collections/collections.ts">get</a>(appId, userId, collectionId) -> Collection</code>
- <code title="get /apps/{app_id}/users/{user_id}/collections/name/{name}">client.apps.users.collections.<a href="./src/resources/apps/users/collections/collections.ts">getByName</a>(appId, userId, name) -> Collection</code>
- <code title="get /apps/{app_id}/users/{user_id}/collections/{collection_id}/query">client.apps.users.collections.<a href="./src/resources/apps/users/collections/collections.ts">query</a>(appId, userId, collectionId, { ...params }) -> CollectionQueryResponse</code>
- <code title="get /apps/{app_id}/users/{user_id}/collections/{collection_id}/documents/query">client.apps.users.collections.<a href="./src/resources/apps/users/collections/collections.ts">query</a>(appId, userId, collectionId, { ...params }) -> CollectionQueryResponse</code>

#### Documents

Expand Down
2 changes: 1 addition & 1 deletion src/resources/apps/users/collections/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class Collections extends APIResource {
query: CollectionQueryParams,
options?: Core.RequestOptions,
): Core.APIPromise<CollectionQueryResponse> {
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,
});
Expand Down
7 changes: 3 additions & 4 deletions src/resources/apps/users/sessions/metamessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
22 changes: 13 additions & 9 deletions src/resources/apps/users/sessions/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<AgentChat> {
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,
});
}
Expand Down Expand Up @@ -145,11 +145,11 @@ export class Sessions extends APIResource {
appId: string,
userId: string,
sessionId: string,
query: SessionStreamParams,
body: SessionStreamParams,
options?: Core.RequestOptions,
): Core.APIPromise<unknown> {
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,
});
}
Expand Down Expand Up @@ -206,11 +206,15 @@ export interface SessionListParams extends PageParams {
}

export interface SessionChatParams {
query: string;
queries: string | Array<string>;

collections?: string | Array<string>;
}

export interface SessionStreamParams {
query: string;
queries: string | Array<string>;

collections?: string | Array<string>;
}

export namespace Sessions {
Expand Down
8 changes: 4 additions & 4 deletions tests/api-resources/apps/users/sessions/sessions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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' },
);
});

Expand Down Expand Up @@ -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);
Expand All @@ -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' },
);
});
});

0 comments on commit 0fe4e34

Please sign in to comment.