feat(streaming): add StreamTokenResponse type and getRecipeStreamToken API
This commit is contained in:
parent
63517d135b
commit
7292c5e7fc
1 changed files with 18 additions and 0 deletions
|
|
@ -525,6 +525,12 @@ export interface RecipeResult {
|
|||
rate_limit_count: number
|
||||
}
|
||||
|
||||
export interface StreamTokenResponse {
|
||||
stream_url: string
|
||||
token: string
|
||||
expires_in_s: number
|
||||
}
|
||||
|
||||
export type RecipeJobStatusValue = 'queued' | 'running' | 'done' | 'failed'
|
||||
|
||||
export interface RecipeJobStatus {
|
||||
|
|
@ -647,6 +653,18 @@ export const recipesAPI = {
|
|||
const response = await api.post('/recipes/build', req)
|
||||
return response.data
|
||||
},
|
||||
|
||||
/** Issue a one-time stream token for LLM recipe generation (Paid tier / BYOK only). */
|
||||
async getRecipeStreamToken(params: {
|
||||
level: 3 | 4
|
||||
wildcard_confirmed?: boolean
|
||||
}): Promise<StreamTokenResponse> {
|
||||
const response = await api.post('/recipes/stream-token', {
|
||||
level: params.level,
|
||||
wildcard_confirmed: params.wildcard_confirmed ?? false,
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
}
|
||||
|
||||
// ========== Settings API ==========
|
||||
|
|
|
|||
Loading…
Reference in a new issue