TypedLLM is a Python repository that streamlines the process of converting unstructured text outputs from large language models into strongly typed dataclasses, like Pydantic, facilitating seamless integration with applications and enhancing data handling for improved consistency and maintainability.
- Installation
- Usage
- Configuration
- API Documentation
- Contributing
- Testing
- License
- Credits/Acknowledgements
- Changelog
- Contact Information
To install TypedLLM, follow these steps:
-
Pip install.
pip install typedllm
-
Clone the repository:
git clone https://github.com/username/TypedLLM.git
Change to the project directory:
cd TypedLLM
Install the required packages:
pip install -r requirements.txt
To use TypedLLM, first import the necessary modules:
from typedllm import TypedLLM, PydanticConverter
Then, create an instance of the converter and process your text output:
converter = PydanticConverter()
typed_output = converter.convert(text_output)
For more detailed examples, please refer to the examples directory.
No specific configuration is required to use TypedLLM. However, you can customize the behavior of the converter by extending the PydanticConverter class and overriding its methods, if needed.
Please refer to the API documentation for a complete list of available functions, classes, methods, and parameters.
We welcome contributions to TypedLLM! To contribute, please follow these guidelines:
- Fork the repository and create your branch from the main branch.
- Make your changes, ensuring you follow the project's coding style and documentation standards.
- Submit a pull request with a clear description of your changes.
Set up a virtual environment:
python3 -m venv venv
source venv/bin/activate
# install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt
# install typedllm
pip install -e .
To run tests for TypedLLM, follow these steps:
Install the required testing packages:
pip install -r requirements-dev.txt
Run the tests:
pytest
TypedLLM is released under the MIT License.
We would like to thank the following libraries and resources that have been instrumental in the development of TypedLLM:
- Pydantic: https://github.com/pydantic/pydantic
- LangChain: https://python.langchain.com/
Please refer to the CHANGELOG.md file for a summary of notable changes in each release of TypedLLM.
For any questions or suggestions, please reach out to the TypedLLM maintainers:
- Email: sean@closedloop.tech
- Twitter: @seankruzel
- GitHub Issues: https://github.com/closedloop/TypedLLM/issues