Improve Pydantic and Typedict support and add a bunch of tets.
1. Fixed the test failure where TypeDict was being serialized as a list
of tuples instead of a dict by:
- Adding proper handling for BaseModel instances in the output.py file
- Converting BaseModel results (from TypeDict conversion) to dicts using
model_dump()
- Handling lists containing BaseModel objects
2. Fixed None handling to ensure None results are converted to empty
strings as expected
3. Updated the schema.py to allow dict and list types in
ToolCallOutput.value
4. new tests
- TypeDict output execution tests
- Output factory tests
- Executor tests with TypeDict support
- Schema validation tests
The key changes were:
- In ``arcade_core/output.py``: Added BaseModel conversion logic in the
success method
- In ``arcade_core/schema.py``: Changed ToolCallOutput.value type from
list[str] to list to support complex types
TODO
- [ ] Confirm engine compatibility without changes made to engine
---------
Co-authored-by: Eric Gustin <eric@arcade.dev>
|
||
|---|---|---|
| .. | ||
| arcade_core | ||
| pyproject.toml | ||
| README.md | ||
Arcade Core
Core library for the Arcade platform providing foundational components and utilities.
Overview
Arcade Core provides the essential building blocks for the Arcade platform:
- Tool Catalog & Toolkit Management: Core classes for managing and organizing tools
- Configuration & Schema Handling: Configuration management and validation
- Authentication & Authorization: Auth providers and security utilities
- Error Handling: Comprehensive error types and handling
- Telemetry & Observability: Monitoring and tracing capabilities
- Utilities: Common helper functions and validators
Installation
pip install arcade-core
Usage
- Install an arcade toolkit
pip install arcade-math
- Load the toolkit
import arcade_math
from arcade_core import ToolCatalog, Toolkit
# Create a tool catalog
catalog = ToolCatalog()
# Load a toolkit
toolkit = Toolkit.from_module(arcade_math)
License
MIT License - see LICENSE file for details.