• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

agentjido / req_llm
59%
main: 49%

Build:
Build:
LAST BUILD BRANCH: feature/azure-deepseek
DEFAULT BRANCH: main
Repo Added 15 Sep 2025 11:42AM UTC
Token Qrw4J5oDDoi2zjHqBZDp1Hok4eVoONJAy regen
Build 508 Last
Files 85
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH fix/cost-calculation-in-usage
branch: fix/cost-calculation-in-usage
CHANGE BRANCH
x
Reset
Sync Branches
  • fix/cost-calculation-in-usage
  • add-bedrock-fixtures
  • add-bedrock-structured-output
  • add-hex-changelog-and-module-grouping
  • add-json-schema-validation
  • add-vertex-guide-to-docs
  • add-vllm-provider
  • add-vllm-support
  • add_openai_responses_api_structured_responses
  • add_retry_step
  • allow_json_schemas
  • bedrock-1.0-fixes
  • bedrock-clean
  • bedrock-mistral-support
  • breaking/reqllm-llmdb-forced
  • bug/api-return-types
  • bug/codec-tool-calls
  • bug/debug-stream-return
  • bug/incorrect-model-spec-docs
  • bug/object-array
  • bug/openai-tool-calls
  • bug/stream-process-linking
  • bug/streaming-nil-deltas
  • bug/streaming-race-condition
  • bug/usage_total_cost
  • bw-openai-responses-api-reasoning-effort
  • cerebras
  • cerebras-zai-glm-4-6
  • chore/2025-10-14-update-fixtures
  • chore/docs-review
  • chore/model_update_2025-10-27
  • chore/object-fixtures
  • chore/object-fixtures-resurrected
  • chore/refine-fixtures
  • chore/refresh-coverage-tests
  • chore/refresh-fixtures-before-1.0
  • chore/update-models-2025-09-21
  • config_base_url_override
  • copilot/fix-32
  • credo-config
  • credo/code-readability-fix
  • credo/fix-refactor-enum-filter
  • dependabot/hex/ex_aws_auth-1.3.1
  • dependabot/hex/ex_doc-0.39.1
  • dependabot/hex/jsv-0.11.5
  • dependabot/hex/req-0.5.16
  • dependabot/hex/tidewave-0.5.1
  • dependabot/hex/zoi-0.8.1
  • dependabot/hex/zoi-0.8.4
  • devtools
  • docs/agent-tutorial
  • docs/aws-event-stream-specialization
  • egomes/fix-claude-multi-turn
  • egomes/fix-tool-inspection-with-json-schema
  • feat/bedrock-service-tiers
  • feat/context-json-serialization
  • feat/fixture-credential-fallback
  • feat/fixture-credential-fallback-rebased
  • feat/google-context-caching
  • feat/google-upload-file
  • feat/in-type-support
  • feat/oauth2-token-cache
  • feat/structured-output-openai-google
  • feat/vertex-gemini-support
  • feature/anthropic-structured-output
  • feature/base-url-override
  • feature/bedrock-prompt-caching
  • feature/cerebras-provider
  • feature/configurable-metadata-timeout
  • feature/custom_providers
  • feature/google_grounding
  • feature/model-catalog
  • feature/normalize-bedrock-inference-profiles
  • feature/pre-release-fixes
  • feature/prompt-caching
  • feature/refactor-llm-api-fixtures
  • feature/refined-key-management
  • feature/stream-collectors
  • feature/unique-model-provider-options
  • feature/upgrade-ex-aws-auth
  • feature/zai-fixtures
  • feature/zoi-schema
  • fix-anthropic-streaming
  • fix-bedrock-timeout
  • fix-duplicate-clause
  • fix-google
  • fix-groq-stream-error
  • fix-mix-task-docs
  • fix-openai-max-tokens-param
  • fix-reasoning-overlay-pattern-match
  • fix-response-process-stream
  • fix-retry-delay-conflict
  • fix-schema-boolean-property
  • fix/bedrock-claude-exclusions
  • fix/bedrock-inference-profiles
  • fix/bug-119-aws-auth-credentials
  • fix/capability-structure-pattern-matches
  • fix/google-cached-tokens
  • fix/google-file-support
  • fix/google-structured-output
  • fix/groq-utf8-streaming
  • fix/http2-large-request-bodies
  • fix/issue-65-http-status-validation
  • fix/issue-96-validation-error-fields
  • fix/jsv-preserve-original-data
  • fix/proxy-options
  • fix/registry-get-provider-nil-module
  • fix/tool-budget-pattern-match
  • fix/tool_calls
  • fix/vertex-decode-stream-event
  • google-vision
  • idempotent-stream-response
  • improve-metadata-provider-errors
  • list_with_subtype
  • main
  • patch-1
  • put-max-tokens-model-options
  • record-bedrock-vertex-fixtures
  • refactor-meta-provider-generic
  • refactor/context-tools
  • refactor/rename-decode-sse-event
  • refactor/req-streaming
  • refactor/xai-structured-objects
  • remove-duplicate-google-provider-metadata
  • remove-jido-keys
  • response-context-append-bug
  • support-openai-tool-choice-required
  • vertex-gemini-rebased
  • zai
  • zw/fix-stream-finish-reason

24 Sep 2025 09:53PM UTC coverage: 58.542% (+0.7%) from 57.807%
d5af793aea4f0a4fb1943d0495ad9a9d92b05ce7-PR-35

Pull #35

github

mikehostetler
Enhance Google provider usage extraction and token handling

- Updated the `extract_usage/2` function in the Google provider to include cached content token handling, improving the accuracy of usage metrics.
- Introduced a new private function, `add_cached_tokens/1`, to manage the addition of cached tokens to the usage data.
- Refactored the `ReqLLM.Step.Usage` module to streamline cached token retrieval and clamping logic, ensuring consistent behavior across different scenarios.
- Added comprehensive tests for cached token scenarios in both the Google provider and usage handling, ensuring robust validation of new functionality.

These changes enhance the overall functionality and reliability of the usage calculation features within the ReqLLM library, providing better support for diverse provider interactions.
Pull Request #35: Fix #31: Add cost calculation to Response.usage()

61 of 61 new or added lines in 3 files covered. (100.0%)

21 existing lines in 4 files now uncovered.

1710 of 2921 relevant lines covered (58.54%)

318.5 hits per line

Relevant lines Covered
Build:
Build:
2921 RELEVANT LINES 1710 COVERED LINES
318.5 HITS PER LINE
Source Files on fix/cost-calculation-in-usage
  • Tree
  • List 56
  • Changed 14
  • Source Changed 0
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
d5af793a... fix/cost-calculation-in-usage Enhance Google provider usage extraction and token handling - Updated the `extract_usage/2` function in the Google provider to include cached content token handling, improving the accuracy of usage metrics. - Introduced a new private function, `a... Pull #35 24 Sep 2025 09:54PM UTC mikehostetler github
58.54
5196e858... fix/cost-calculation-in-usage Formatting Pull #35 21 Sep 2025 09:38PM UTC mikehostetler github
58.46
96318720... fix/cost-calculation-in-usage Formatting Pull #35 21 Sep 2025 08:45PM UTC mikehostetler github
58.17
See All Builds (471)

Badge your Repo: req_llm

We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.

Could not find badge in README.

Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

Refresh
  • Settings
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc