dzhng / zod-gpt

Get structured, fully typed, and validated JSON outputs from OpenAI and Anthropic models.
MIT License
588 stars 12 forks source link

Auto healing and tokens usage question #5

Open jankulma opened 1 year ago

jankulma commented 1 year ago

Auto Healing [...] This means whenever these types of errors happen, zod-gpt will send a new message to re-ask the model to correct its own output [...]

Does the response.usage contain sum of usage for all attempts, or just the last, successful attempt?

dzhng commented 1 year ago

it just contains the last attempt - this is a good catch. Will leave this open to track, but tbh not a super priority for me right now. The actual logic to add this would actually be in the underlying llm-api package if you want to give it a shot.

benjick commented 11 months ago

Any workaround to get the full token consumption for now?