Record model and cost when reporting logs (#136)

* Rename prompt and completion tokens to input and output tokens

* Add getUsage function

* Record model and cost when reporting log

* Remove unused imports

* Move UsageGraph to its own component

* Standardize model response fields

* Fix types
This commit is contained in:
arcticfly
2023-08-11 13:56:47 -07:00
committed by GitHub
parent f270579283
commit 8d1ee62ff1
24 changed files with 295 additions and 199 deletions

View File

@@ -71,7 +71,7 @@ export const runOneEval = async (
provider: SupportedProvider,
): Promise<{ result: number; details?: string }> => {
const modelProvider = modelProviders[provider];
const message = modelProvider.normalizeOutput(modelResponse.output);
const message = modelProvider.normalizeOutput(modelResponse.respPayload);
if (!message) return { result: 0 };