- Issue created by @tonytosta
- 🇺🇸United States tonytosta
Cost Example
Create a “Cost” Log Type
- Leverage the ‘Extra Data’ field to hold different data depending on the Log Type
- Generic > debugging data
- Cost > token usage data (see below for sample data from OpenAI / ChatGpT)
Observations
- Adding a view to display these Cost logs is easy enough, but each must be able to reference the ‘generic’ log (or prompt) it is related to
- I am leveraging log->id() to see if that is a good way but it will never be as good as if we had all logs grouped by an ID based on the prompt
- Given that multiple logs (e.g., Generic, Cost, etc.,) can be made from one prompt, it may be a good idea to group them all
- I suppose we could use prompt, but that is not reliable
- Maybe an additional light weight entity is needed?
- We may want to include a reference to the user that made the prompt, to better report on usage and costs
Next Steps
Add additional providers (that may have a different 'location' for its usage data)
Usage Example from ChaptGPT
array:5 [▼ "prompt_tokens" => 5218 "completion_tokens" => 305 "total_tokens" => 5523 "prompt_tokens_details" => array:2 [▶] "completion_tokens_details" => array:4 [▶] ]
I
- 🇦🇲Armenia murz Yerevan, Armenia
Updated the issue description following the current plan.
- @murz opened merge request.
- 🇦🇲Armenia murz Yerevan, Armenia
Shared a draft of the developing module. For now, it requires patches from the issues:
- ✨ Rework AI Logging to use the standard PSR Logger interface with passing metadata in context Active
- ✨ Add Views plugins to filter by JSONPath value Active - Assigned to murz
- Status changed to Needs work
2 months ago 12:30pm 10 September 2025