Langroid

Latest version: v0.42.3

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 21 of 66

0.9.2

fix: GPT4o -> gpt-4o-2024-08-06, pricing

0.9.1

fix: Make various orchestration tools visible via `langroid.agent.tools.*`, e.g:

import langroid as lr
AgentDoneTool = lr.agent.tools.AgentDoneTool

0.9.0

feat: Orchestration tools for:
- agent or LLM to signal task done, with content (str) as result: `DoneTool`
- agent to signal task done, with content or tools as result: `AgentDoneTool`
- agent or LLM to "Pass" incoming message for next responder: `PassTool`
- agent or LLM to signal "done" *and* pass the incoming message (containing content or tools) as result: `DonePassTool`
- agent or LLM to *forward* incoming message (with content or tools) to a specific agent: `ForwardTool`
- agent or LLM to *send* a message (with string content but no tools) to a specific agent: `SendTool`
- agent to *send* a message (with string content or tools) to a specific agent: `AgentSendTool`

These are intended to replace the string-based signaling mechanisms such as DONE, PASS, SEND, etc,
which are depcrecated but still supported. The older signaling mechanisms are considered fragile since such strings can accidentally appear in retrieved docs/prompts etc (so-called *accidental prompt injection*). Moreover, some of these tools add new capabilities: send tools as part of a task result (not just string content), and sending tools to other agents (note `RecipientTool` can only send content but not tools).

- With this release, any tool handler method can return a `ToolMessage` (previously only returning a `str|ChatDocument` was possible). This proves very convenient in complex workflows (see examples below).
- Any `ChatAgent`-derived class can define an `init_state()` fn that is initialized whenever the agent's task starts. This method can initialize state vars that are useful to control the flow of a task.

For details see:
- implementation: https://github.com/langroid/langroid/blob/main/langroid/agent/tools/orchestration.py
- tests: https://github.com/langroid/langroid/blob/main/tests/main/test_tool_orchestration.py; in addition, many other tests now contain the above orchestration tools as well (e.g. `test_task.py`, `test_multi_agent.py`, etc).
- examples of complex workflows using these tools:
- Multi-agent search-assistant with critic: https://github.com/langroid/langroid/tree/main/examples/basic/multi-agent-search-critic
- Lance doc query planner with critic: https://github.com/langroid/langroid/tree/main/langroid/agent/special/lance_rag, with corresponding tests:
https://github.com/langroid/langroid/blob/main/tests/main/test_lance_doc_chat_agent.py

0.8.0

feat: SqlChatAgent support for database-update queries

0.7.0

feat: Support OpenAI Tools API, including multi-tool generation and handling. Previously only the function-call API was supported, which is now deprecrated by OpenAI.

In particular this means langroid can be used with Ollama's new OpenAI-compatible tools support.
(Note that langroid-native tools have always worked with any strong-enough LLM, since langroid translates Pydantic-based tool definitions to JSON instructions in the system msg).

To use the tools api, you must set:
- `ChatAgentConfig.use_functions_api = True`
- `ChatAgentCofig.use_tools_api = True` (default is `False`)

The first option above is a flag to decide between using OpenAI tools OR functions API rather than using Langroid-native Tools.

The second option is only considered when `use_functions_api` is `True`: in this case if `use_tools_api=True`, then the tools API is used, else the
older/deprecated function-calling API is used.

The reason we default the second option to `False` is that there are some tricky aspects to the tools API, e.g. it is more "strict", in the sense a tool-call message must be followed by messages containing results, which the functions API does not enforce. Langroid has mechanisms to ensure the tools API works correctly, however in practice we find the functions API OR the langroid Tools more straightforward to work. The strictness of the tools API makes some agent workflows harder to achieve, e.g. where a tool is sent by one agent and executed by another. Also, multi-tool generation, while it sounds useful, brings some complications in agent workflows. Again, langroid does ensure these work correctly in most scenarios, but it's possible some edge cases remain.

0.6.7

fix: Neo4jChatAgent - `retrieval_query` use str() not json.dumps()

Page 21 of 66

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.