refactor(provider): simplify LiteLLM requester usage handling

- Remove unused Anthropic-specific tool schema generation
  - Share completion argument construction between normal and streaming calls
  - Use LiteLLM/OpenAI native usage fields for monitoring
  - Collect stream token usage from LiteLLM stream_options
  - Update LiteLLM requester tests for unified usage fields
This commit is contained in:
huanghuoguoguo
2026-04-25 09:22:37 +08:00
parent b33d05f99a
commit d170bdd343
4 changed files with 58 additions and 84 deletions

View File

@@ -93,8 +93,6 @@ class TestExtractUsage:
assert result['prompt_tokens'] == 100
assert result['completion_tokens'] == 50
assert result['total_tokens'] == 150
assert result['input_tokens'] == 100 # Compatibility alias
assert result['output_tokens'] == 50 # Compatibility alias
def test_extract_usage_with_zero_values(self):
"""Test extraction when values are 0"""