-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Edge runtime finish reason, logprobs and token count streaming (#…
…450)
- Loading branch information
Showing
8 changed files
with
83 additions
and
13 deletions.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
packages/react/src/runtimes/edge/streams/AssistantStreamPart.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
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
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
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
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
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 |
---|---|---|
@@ -1,21 +1,27 @@ | ||
"use client"; | ||
import type { | ||
MessageStatus, | ||
ThreadAssistantContentPart, | ||
ThreadMessage, | ||
} from "../../types/AssistantTypes"; | ||
import type { ModelConfig } from "../../types/ModelConfigTypes"; | ||
|
||
export type ChatModelRunUpdate = { | ||
content: ThreadAssistantContentPart[]; | ||
}; | ||
|
||
export type ChatModelRunResult = { | ||
content: ThreadAssistantContentPart[]; | ||
status?: MessageStatus; | ||
}; | ||
|
||
export type ChatModelRunOptions = { | ||
messages: ThreadMessage[]; | ||
abortSignal: AbortSignal; | ||
config: ModelConfig; | ||
onUpdate: (result: ChatModelRunResult) => void; | ||
onUpdate: (result: ChatModelRunUpdate) => void; | ||
}; | ||
|
||
export type ChatModelAdapter = { | ||
run: (options: ChatModelRunOptions) => Promise<ChatModelRunResult | void>; | ||
run: (options: ChatModelRunOptions) => Promise<ChatModelRunResult>; | ||
}; |
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