Allow async streamFn for dynamic proxy settings

- StreamFn type now allows returning Promise
- agent-loop awaits streamFn result
- createStreamFn takes getProxyUrl callback, reads settings on each call
This commit is contained in:
Mario Zechner 2025-12-28 11:39:46 +01:00
parent e0be2e650d
commit 92898f486b
4 changed files with 16 additions and 11 deletions

View file

@ -211,7 +211,7 @@ async function streamAssistantResponse(
const resolvedApiKey =
(config.getApiKey ? await config.getApiKey(config.model.provider) : undefined) || config.apiKey;
const response = streamFunction(config.model, llmContext, {
const response = await streamFunction(config.model, llmContext, {
...config,
apiKey: resolvedApiKey,
signal,