Skip to content

Conversation

@mattapperson
Copy link
Collaborator

@mattapperson mattapperson commented Nov 21, 2025

Summary

  • Add getResponse() method to ResponseWrapper for accessing complete response including usage data (inputTokens, outputTokens, cachedTokens, reasoningTokens, etc.)
  • Update callModel documentation to include the new method
  • Add comprehensive tests for response shape validation including all usage fields
  • Add tests for provider parameter support

Usage

const response = client.callModel({
  model: "openai/gpt-4",
  input: "Hello!"
});

const fullResponse = await response.getResponse();
console.log(fullResponse.usage?.inputTokensDetails?.cachedTokens);

Test plan

  • All 70 callModel e2e tests pass
  • TypeScript compiles without errors
  • New getResponse() tests verify usage shape including cachedTokens
  • New provider parameter tests verify routing preferences work

@mattapperson mattapperson changed the title feat: add getResponse() method to expose full response with usage data feat: add getResponse() to callModel for accessing full response with usage data Nov 21, 2025
@mattapperson mattapperson force-pushed the feat/add-getresponse-method branch from 8087474 to 4c7b5c2 Compare November 21, 2025 19:51
@mattapperson mattapperson changed the title feat: add getResponse() to callModel for accessing full response with usage data feat: add callModel() method for accessing full response with usage data Nov 21, 2025
- Add getResponse() method to ResponseWrapper for accessing complete response including usage (inputTokens, outputTokens, cachedTokens, etc.)
- Add comprehensive tests for response shape validation
- Add tests for provider parameter support
@mattapperson mattapperson force-pushed the feat/add-getresponse-method branch from 4c7b5c2 to a77b89e Compare November 21, 2025 19:51
@mattapperson mattapperson changed the title feat: add callModel() method for accessing full response with usage data feat: add getResponse() method for accessing full response with usage data Nov 21, 2025
@mattapperson mattapperson merged commit 75b7e29 into main Nov 21, 2025
3 checks passed
@mattapperson mattapperson deleted the feat/add-getresponse-method branch November 21, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants