docs: lm studio (#398)

* docs(page): lm studio doc
* docs: update documentation and improve model section
This commit is contained in:
Simon
2026-04-04 01:15:41 +08:00
committed by GitHub
parent e290e2f67a
commit 9cc9edf17e
5 changed files with 177 additions and 122 deletions

View File

@@ -274,10 +274,12 @@ function ApiErrorsContent(isZh: boolean) {
code={`const agent = new PageAgent({
// ...
customFetch: async (url, init) => {
const body = JSON.parse(init.body)
// Adapt parameters for your provider
delete body.stream_options
return fetch(url, { ...init, body: JSON.stringify(body) })
const body = JSON.parse(init.body)
delete body.tool_choice
const bodyStr = JSON.stringify(body)
return fetch(url, { ...init, body: bodyStr })
},
})`}
/>