diff --git a/index.ts b/index.ts index 2d5566d..30f7c5a 100644 --- a/index.ts +++ b/index.ts @@ -846,8 +846,7 @@ async function chat(text: string, files: PromptFiles = []) { const agent = await resolveAgent() const body: Record = { - providerID, - modelID, + model: { providerID, modelID }, ...(agent ? { agent } : {}), parts: [ { @@ -874,7 +873,7 @@ async function chat(text: string, files: PromptFiles = []) { ], } - const chatRes = await fetch(`${SERVER_URL}/session/${session.id}/chat`, { + const chatRes = await fetch(`${SERVER_URL}/session/${session.id}/message`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body),