mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-15 21:24:48 +00:00
fix: permissions, sidebar and system prompt
This commit is contained in:
@@ -151,6 +151,13 @@ export function createToothFairyAI(options: ToothFairyAIProviderSettings = {}):
|
||||
finish_reason: parsed.choices[0].finish_reason,
|
||||
})
|
||||
}
|
||||
if (parsed.usage) {
|
||||
log.info("stream usage", {
|
||||
prompt_tokens: parsed.usage.prompt_tokens,
|
||||
completion_tokens: parsed.usage.completion_tokens,
|
||||
total_tokens: parsed.usage.total_tokens,
|
||||
})
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
} else {
|
||||
@@ -181,6 +188,7 @@ export function createToothFairyAI(options: ToothFairyAIProviderSettings = {}):
|
||||
headers: () => baseHeaders,
|
||||
url: ({ path }) => `${baseURL}${path}`,
|
||||
fetch: customFetch as FetchFunction,
|
||||
includeUsage: true,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user