Skip to content

Commit

Permalink
Update publicStream parameter names
Browse files Browse the repository at this point in the history
  • Loading branch information
StreetLamb committed Sep 2, 2024
1 parent 91794c8 commit 442c63c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 5 deletions.
31 changes: 26 additions & 5 deletions frontend/src/client/services/TeamsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,45 @@ export class TeamsService {

/**
* Public Stream
* Stream a response with api key
* Stream a response from a team using a given message or an interrupt decision. Requires an API key for authentication.
*
* This endpoint allows streaming responses from a team based on a provided message or interrupt details. The request must include an API key for authorization.
*
* Parameters:
* - `team_id` (int): The ID of the team to which the message is being sent. Must be a valid team ID.
* - `thread_id` (str): The ID of the thread where the message will be posted. If the thread ID does not exist, a new thread will be created.
*
* Request Body (JSON):
* - The request body should be a JSON object containing either the `message` or `interrupt` field:
* - `message` (object, optional): The message to be sent to the team.
* - `type` (str): Must be `"human"`.
* - `content` (str): The content of the message to be sent.
* - `interrupt` (object, optional): Approve/reject tool or reply to an ask-human tool.
* - `decision` (str): Can be `'approved'`, `'rejected'`, or `'replied'`.
* - `tool_message` (str or null, optional): If `decision` is `'rejected'` or `'replied'`, provide a message explaining the reason for rejection or the reply.
*
* Authorization:
* - API key must be provided in the request header as `x-api-key`.
*
* Responses:
* - `200 OK`: Returns a streaming response in `text/event-stream` format containing the team's response.
* @returns any Successful Response
* @throws ApiError
*/
public static publicStream({
id,
teamId,
threadId,
requestBody,
}: {
id: number,
teamId: number,
threadId: string,
requestBody: TeamChatPublic,
}): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'POST',
url: '/api/v1/teams/{id}/stream-public/{thread_id}',
url: '/api/v1/teams/{team_id}/stream-public/{thread_id}',
path: {
'id': id,
'team_id': teamId,
'thread_id': threadId,
},
body: requestBody,
Expand Down
26 changes: 26 additions & 0 deletions frontend/src/client/services/ThreadsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,30 @@ export class ThreadsService {
});
}

/**
* Read Thread Public
* Get thread and its last checkpoint by ID
* @returns ThreadRead Successful Response
* @throws ApiError
*/
public static readThreadPublic({
threadId,
teamId,
}: {
threadId: string,
teamId: number,
}): CancelablePromise<ThreadRead> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/v1/teams/{team_id}/threads/public/{thread_id}',
path: {
'thread_id': threadId,
'team_id': teamId,
},
errors: {
422: `Validation Error`,
},
});
}

}

0 comments on commit 442c63c

Please sign in to comment.