Langroid

Latest version: v0.2.6

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

Scan your dependencies

Page 26 of 42

0.1.118

Minor update: OpenAIAssistant default to gpt4-turbo

0.1.117

Minor Update of 0.1.116. Please see that release for notes.

0.1.116

Support for OpenAI Assistant API.
This has been gradually extended over several releases, so summarizing here:
You can define a Langroid OpenAIAssistant as a subclass of ChatAgent.
These agents can be used as drop-in replacements for ChatAgent within tasks, and work seamlessly
with Langroid's task orchestration.

The OpenAIAssistant agent leverages several features of the OpenAI Assistant API:
* conversation state (so no need to maintain conv state as in ChatAgent)
* thread, assistant persistence with caching: thread_id, assistant_id are cached based on user/machine/org and can be resumed across sessions.
* Tools: Function-calling, Retrieval, Code-Interpreter
* File uploads

Until docs are ready, it's best to see these examples:

Tests:
* [test_openai_assistant.py](https://github.com/langroid/langroid/blob/main/tests/main/test_openai_assistant.py)
* [test_openai_assistant_async.py](https://github.com/langroid/langroid/blob/main/tests/main/test_openai_assistant_async.py)

Example scripts:
* [examples/basic/oai-asst-chat.py](https://github.com/langroid/langroid/blob/main/examples/basic/oai-asst-chat.py) The most basic simple chat
* [examples/basic/oai-code-chat.py](https://github.com/langroid/langroid/blob/main/examples/basic/oai-code-chat.py) Chat with code interpreter.
* [examples/docqa/oai-retrieval-assistant.py](https://github.com/langroid/langroid/blob/main/examples/docqa/oai-retrieval-assistant.py) Basic retrieval
(RAG) chat.
* [examples/docqa/oai-retrieval-2.py](https://github.com/langroid/langroid/blob/main/examples/docqa/oai-retrieval-2.py) 2-agent chat with retrieval

0.1.114

Support OpenAI Assistant tools:
* Retrieval tool
* Function-calling
These work seamlessly with Langroid's multi-task interaction.
Until docs are ready, see these tests:
- [`test_openai_assistant.py`](https://github.com/langroid/langroid/blob/main/tests/main/test_openai_assistant.py),
- [`test_openai_assistant_async.py`](https://github.com/langroid/langroid/blob/main/tests/main/test_openai_assistant_async.py)

0.1.113

minor: RediCache now uses ConnectionPool and context manager to avoid max connections exceeded errors.

0.1.112

Initial support for OpenAI Assitant API:
OpenAIAssistant is a sublcass of ChatAgent that leverages the Assistant API,
and can be used as a drop-in replacement for ChatAgent (in tasks, batch/async runs etc).
The main feature of a OpenAIAssistant is that instead of maintaining conversation state
(like a ChatAgent normally does), it relies on the Assistant API to do this.
This agent also leverages persistence of Assistant and Thread on OpenAI servers:
it caches the Assistant ID and Thread ID, and retrieves them and reuses them
based on config settings.

Class defn: langroid/agent/openai_assistant.py
Example uses: tests/main/test_openai_assistant.py, tests/main/test_openai_assistant_async.py

Note: File uploads, code-interpreter tools are not yet supported.
Example scripts coming soon.

Page 26 of 42

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.