Metadata-Version: 2.1
Name: dynamic-pydantic
Version: 0.1.0
Summary: Dynamic Pydantic is the easiest way to create and validate AI agent tools and databases.
Author-email: Luka <luka@lukafilipovic.com>
License: MIT License
        
        Copyright (c) 2024 Luka Filipovic
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Repository, https://github.com/lukafilipxvic/dynamic-pydanticv
Project-URL: Changelog, https://github.com/lukafilipxvic/dynamic-pydantic/blob/main/CHANGELOG.md
Project-URL: Releases, https://github.com/lukafilipxvic/dynamic-pydantic/releases
Keywords: instructor,pydantic,AI Agents
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: instructor
Requires-Dist: litellm
Requires-Dist: pydantic>=2.0.0
Provides-Extra: examples
Requires-Dist: stealth-requests[parsers]; extra == "examples"

# Dynamic Pydantic
**Dynamic Pydantic is the easiest way for AI agents to create and validate tools and databases in runtime.**

It is a provides a powerful approach to creating pydantic models dynamically for any given task.

The project leverages Instructor and Pydantic to generate models dynamically based on provided prompt and context.

## Installation
```bash
pip install dynamic-pydantic
```

## Contributing
Start contributing by cloning the repository:
```bash
git clone https://github.com/lukafilipxvic/dynamic-pydantic.git
```

## Usage
This package simplifies the interaction between language models and pydantic's ```create_model()``` function.
Below is a basic example showcasing the generation of a Pydantic schema with Cerebras' Llama 3.3 70b inference.

Dynamic Pydantic works with any OpenAI-compatible endpoint via LiteLLM.

```
from dynamic_pydantic import dynamic_model

genModel = dynamic_model(prompt='User = Name, Age')

print(f'{genModel.schema_json()}')

# {"properties": {"Name": {"default": null, "description": "The user's name", "title": "Name", "type": "string"}, "Age": {"default": null, "description": "The user's age", "title": "Age", "type": "integer"}}, "title": "User", "type": "object"}

```

## License
This project is licensed under the terms of the MIT license.

For more details, refer to the LICENSE file in the repository.
