Problem/Motivation

The /admin/reports/ai-metering repot doesn't seem to account for multiple providers.

I have a fresh site and and have made some Chat generation explorer requests from 3 different providers. When I got to the report, I see:

Screenshot of report.

If I click on the "View calls" link, I see:

Screenshot of report.

Steps to reproduce

Fresh Drupal 11 site, latest release versions of relevant modules, make 3 Chat generation explorer calls from 3 different providers.

Environment

  • Drupal version: 11.4.3
  • ai_metering version: 1.0.0-beta1
  • AI provider module + version (e.g. ai_provider_anthropic 1.x): amazee.ai Private AI Provider 1.3.2 and Anthropic Provider 1.2.2 and OpenAI Provider 1.2.3
  • AI feature module tested (e.g. ai_translate, ai_chatbot, ai_assistant_api, ai_summarize...): Chat generation explorer

Proposed resolution

I would expect to see one row for each provider on /admin/reports/ai-metering

Remaining tasks

User interface changes

N/A

API changes

N/A

Data model changes

N/A

AI assistance

N/A — or: AI-Generated: Yes (tool — what was generated).

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ultimike created an issue. See original summary.

ultimike’s picture

Issue summary: View changes
codeitwisely’s picture

hey @ultimike thanks for the feedback !
The user report currently groups usage by user (one row per editor), so a single user who calls several providers collapses into one row. The row totals (calls, tokens, cost) are correct and include every provider, but the Provider column shows only one of them (currently the highest-cost provider), which is misleading once more than one is in play.

The per-call data is intact: as your "View calls" screenshot shows, the log lists each call with its own provider, so nothing is lost.

I will definitly update how results are rendered here in 'admin/reports/ai-metering'!

codeitwisely’s picture

Assigned: Unassigned » codeitwisely
ultimike’s picture

@codeitwisely - Understood, an easy solution (IMHO) would be to just update the "Provider" column with a comma-separate-list of providers used - that way it provides the necessary information and doesn't look incorrect.

thanks,
-mike

codeitwisely’s picture

@ultimike The fix will be available in the next release!

  • codeitwisely committed 5cb6780b on 1.0.x
    Issue #3610993 by codeitwisely, ultimike: List every provider used per...
codeitwisely’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

ultimike’s picture

@codeitwisely - Thank you! We checked it out (briefly) during class today and it does exactly what we expected!

Appreciate the quick turnaround.

-mike

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.