feat(llms): add transformRequestBody hook and improve prompt assembly (#480)
* feat(llms): add transformRequestBody hook and refine prompt handling * docs(website): document transformRequestBody usage * refactor(extension): keep function-valued config handling consistent in useAgent * feat: simplify `transformRequestBody` --------- Co-authored-by: Simon <10131203+gaomeng1900@users.noreply.github.com>
This commit is contained in:
@@ -21,6 +21,7 @@ export function parseLLMConfig(config: LLMConfig): Required<LLMConfig> {
|
||||
apiKey: config.apiKey || '',
|
||||
temperature: config.temperature ?? DEFAULT_TEMPERATURE,
|
||||
maxRetries: config.maxRetries ?? LLM_MAX_RETRIES,
|
||||
transformRequestBody: config.transformRequestBody ?? ((requestBody) => requestBody),
|
||||
disableNamedToolChoice: config.disableNamedToolChoice ?? false,
|
||||
customFetch: (config.customFetch ?? fetch).bind(globalThis), // fetch will be illegal unless bound
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user