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:
Loris Jautakas
2025-06-14 02:32:35 +08:00
committed by GitHub
co-authored by Neko
parent 1db823d9e3
commit c24e711741
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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(),
+1 -1
View File
@@ -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 () => [