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

agentjido / req_llm / 59f7c6f6b50d40a11a5550aab27255b3024c7011

14 Oct 2025 04:26PM UTC coverage: 51.226% (-0.8%) from 52.002%
59f7c6f6b50d40a11a5550aab27255b3024c7011

push

github

web-flow
Refactor context and message handling for tool calls (#98)

* Refactor context and message handling for tool calls

- Updated `ReqLLM.Context` to replace `push_user`, `push_assistant`, and `push_system` with `append` and `prepend` methods for better clarity and consistency.
- Introduced `ReqLLM.ToolCall` struct to represent tool calls, aligning with OpenAI's API format.
- Modified message structures to utilize `tool_calls` instead of content parts for tool-related interactions.
- Enhanced encoding and decoding processes across providers to support the new tool call structure.
- Removed deprecated content part types related to tool calls and results, streamlining the message handling logic.
- Updated tests to reflect changes in tool call handling and ensure compatibility with existing functionality.

This refactor aims to improve the clarity and maintainability of the codebase while ensuring robust handling of tool calls in conversations.

* Add example scripts for context reuse, cross-model context, and reasoning tokens

- Introduced new example scripts demonstrating various functionalities of the ReqLLM library, including:
  - `context_reuse.exs`: Shows how the same context can be passed between different API functions without modifications.
  - `context_cross_model.exs`: Demonstrates context reuse across different models and providers.
  - `reasoning_tokens.exs`: Illustrates reasoning token usage with models that support extended thinking.
  - `run_all.sh`: A script to run all example scripts sequentially for demonstration purposes.

- Updated README.md to include usage instructions and examples for the new scripts, enhancing documentation and usability for users.

This commit aims to enrich the library's examples and improve user experience by providing runnable scripts for various functionalities.

* Enhance context and tool call handling in ReqLLM

- Updated `ReqLLM.Context` to improve the handling of assistant messages with tool calls, ensuring ... (continued)

110 of 305 new or added lines in 20 files covered. (36.07%)

11 existing lines in 5 files now uncovered.

2799 of 5464 relevant lines covered (51.23%)

180.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/examples/scripts/helpers.ex


Source Not Available

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

© 2026 Coveralls, Inc