fix(stage) Player2 api typo, also replace error role with user role when calling api (#207)
* fix player2 api and replace error role with user for api calls * Update packages/stage-ui/src/stores/llm.ts Co-authored-by: Neko <neko@ayaka.moe> --------- Co-authored-by: Neko <neko@ayaka.moe>
This commit is contained in:
@@ -21,7 +21,8 @@ export const useLLM = defineStore('llm', () => {
|
||||
return await streamText({
|
||||
...chatProvider.chat(model),
|
||||
maxSteps: 10,
|
||||
messages,
|
||||
// TODO: proper format for other error messages.
|
||||
messages: messages.map(msg => ({ ...msg, content: (msg.role as string === 'error' ? `User encountered error: ${msg.content}` : msg.content), role: (msg.role as string === 'error' ? 'user' : msg.role) } as Message)),
|
||||
headers,
|
||||
tools: [
|
||||
...await mcp(),
|
||||
|
||||
@@ -903,7 +903,7 @@ export const useProvidersStore = defineStore('providers', () => {
|
||||
baseUrl: 'http://localhost:4315/v1/',
|
||||
},
|
||||
createProvider: (config) => {
|
||||
return createPlayer2((config.baseURL as string).trim())
|
||||
return createPlayer2((config.baseUrl as string).trim())
|
||||
},
|
||||
capabilities: {
|
||||
listModels: async () => [
|
||||
|
||||
Reference in New Issue
Block a user