generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add new schemas for streaming (#277)
* add new schemas * fix * fix * update yaml
- Loading branch information
1 parent
913bc5a
commit eb7a4ec
Showing
9 changed files
with
365 additions
and
165 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
packages/orchestration/src/client/api/schema/chat-delta.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. | ||
* | ||
* This is a generated file powered by the SAP Cloud SDK for JavaScript. | ||
*/ | ||
|
||
/** | ||
* Representation of the 'ChatDelta' schema. | ||
*/ | ||
export type ChatDelta = { | ||
role?: string; | ||
content: string; | ||
} & Record<string, any>; |
18 changes: 18 additions & 0 deletions
18
packages/orchestration/src/client/api/schema/completion-post-response-streaming.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. | ||
* | ||
* This is a generated file powered by the SAP Cloud SDK for JavaScript. | ||
*/ | ||
import type { ModuleResults } from './module-results.js'; | ||
import type { LLMModuleResultStreaming } from './llm-module-result-streaming.js'; | ||
/** | ||
* Representation of the 'CompletionPostResponseStreaming' schema. | ||
*/ | ||
export type CompletionPostResponseStreaming = { | ||
/** | ||
* ID of the request | ||
*/ | ||
request_id: string; | ||
module_results?: ModuleResults; | ||
orchestration_result?: LLMModuleResultStreaming; | ||
} & Record<string, any>; |
16 changes: 16 additions & 0 deletions
16
packages/orchestration/src/client/api/schema/filtering-stream-options.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. | ||
* | ||
* This is a generated file powered by the SAP Cloud SDK for JavaScript. | ||
*/ | ||
|
||
/** | ||
* Stream options for output filtering. Will be ignored if stream is false. | ||
*/ | ||
export type FilteringStreamOptions = { | ||
/** | ||
* Number of characters that should be additionally sent to content filtering services from previous chunks as additional context. | ||
* Maximum: 10000. | ||
*/ | ||
overlap?: number; | ||
}; |
18 changes: 18 additions & 0 deletions
18
packages/orchestration/src/client/api/schema/global-stream-options.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. | ||
* | ||
* This is a generated file powered by the SAP Cloud SDK for JavaScript. | ||
*/ | ||
|
||
/** | ||
* Options for streaming. Will be ignored if stream is false. | ||
*/ | ||
export type GlobalStreamOptions = { | ||
/** | ||
* Number of characters per chunk that post-LLM modules operate on. | ||
* Default: 100. | ||
* Maximum: 10000. | ||
* Minimum: 1. | ||
*/ | ||
chunk_size?: number; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/orchestration/src/client/api/schema/llm-choice-streaming.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. | ||
* | ||
* This is a generated file powered by the SAP Cloud SDK for JavaScript. | ||
*/ | ||
import type { ChatDelta } from './chat-delta.js'; | ||
/** | ||
* Representation of the 'LLMChoiceStreaming' schema. | ||
*/ | ||
export type LLMChoiceStreaming = { | ||
/** | ||
* Index of the choice | ||
*/ | ||
index: number; | ||
delta: ChatDelta; | ||
/** | ||
* Log probabilities | ||
*/ | ||
logprobs?: Record<string, number[]>; | ||
/** | ||
* Reason for stopping the model | ||
*/ | ||
finish_reason?: string; | ||
} & Record<string, any>; |
37 changes: 37 additions & 0 deletions
37
packages/orchestration/src/client/api/schema/llm-module-result-streaming.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. | ||
* | ||
* This is a generated file powered by the SAP Cloud SDK for JavaScript. | ||
*/ | ||
import type { LLMChoiceStreaming } from './llm-choice-streaming.js'; | ||
import type { TokenUsage } from './token-usage.js'; | ||
/** | ||
* Output of LLM module. Follows the OpenAI spec. | ||
*/ | ||
export type LLMModuleResultStreaming = { | ||
/** | ||
* ID of the response | ||
*/ | ||
id: string; | ||
/** | ||
* Object type | ||
*/ | ||
object: string; | ||
/** | ||
* Unix timestamp | ||
*/ | ||
created: number; | ||
/** | ||
* Model name | ||
*/ | ||
model: string; | ||
/** | ||
* System fingerprint | ||
*/ | ||
system_fingerprint?: string; | ||
/** | ||
* Choices | ||
*/ | ||
choices: LLMChoiceStreaming[]; | ||
usage?: TokenUsage; | ||
} & Record<string, any>; |
42 changes: 42 additions & 0 deletions
42
packages/orchestration/src/client/api/schema/llm-module-result-synchronous.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. | ||
* | ||
* This is a generated file powered by the SAP Cloud SDK for JavaScript. | ||
*/ | ||
import type { LlmChoice } from './llm-choice.js'; | ||
import type { TokenUsage } from './token-usage.js'; | ||
/** | ||
* Output of LLM module. Follows the OpenAI spec. | ||
*/ | ||
export type LLMModuleResultSynchronous = { | ||
/** | ||
* ID of the response | ||
* @example "chatcmpl-9rO0aLoPKY7RtqkWi1317bazHEVFr" | ||
*/ | ||
id: string; | ||
/** | ||
* Object type | ||
* @example "chat.completion" | ||
*/ | ||
object: string; | ||
/** | ||
* Unix timestamp | ||
* @example 1722510700 | ||
*/ | ||
created: number; | ||
/** | ||
* Model name | ||
* @example "gpt-4" | ||
*/ | ||
model: string; | ||
/** | ||
* System fingerprint | ||
* @example "fp_44709d6fcb" | ||
*/ | ||
system_fingerprint?: string; | ||
/** | ||
* Choices | ||
*/ | ||
choices: LlmChoice[]; | ||
usage: TokenUsage; | ||
} & Record<string, any>; |
Oops, something went wrong.