Add default views to the AI Logging module

Created on 10 July 2025, 4 months ago

The AI Logging module should provide useful presentation of logs upon installation.

Steps to reproduce (required for bugs, but not feature requests)

I will list these steps even though it is not required:

  1. Install AI module
  2. Install AI Logging module
  3. Install Views module
  4. See views of logs (e.g., costs; specifics to be determined)

Proposed resolution

  • Add configs for useful views in the AI Logging module's install folder
  • Consider using tags to mate views to details in this report

Remaining tasks

  • Review default log items that are created via the AI Logging module
  • Review this report
  • Define and commit views exports to the AI Logging module

Dependencies

AI Logging module should be able to generate useful logs that the view(s) can display, filter, etc.,

Feature request
Status

Active

Version

1.1

Component

AI Logging

Created by

🇺🇸United States tonytosta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @tonytosta
  • 🇺🇸United States tonytosta

    Cost Example

    Create a “Cost” Log Type

    1. Leverage the ‘Extra Data’ field to hold different data depending on the Log Type
    2. Generic > debugging data
    3. 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

  • 🇺🇸United States tonytosta

    This will be its own submodule in the AI module.

  • 🇦🇲Armenia murz Yerevan, Armenia

    Updated the issue description following the current plan.

  • 🇦🇲Armenia murz Yerevan, Armenia
  • @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
Production build 0.71.5 2024