Overview
BrainyFlow does not provide built-in utilities. Instead, we offer examples that you can implement yourself. This approach gives you more flexibility and control over your project's dependencies and functionality.
Available Utility Function Examples
LLM Wrapper: Interact with Language Models
Web Search: Perform web searches
Chunking: Split large texts into manageable chunks
Embedding: Generate vector embeddings for text
Vector Databases: Store and query vector embeddings
Text-to-Speech: Convert text to speech
Why Not Built-in?
We believe it's a bad practice to include vendor-specific APIs in a general framework for several reasons:
API Volatility: Frequent changes in external APIs lead to heavy maintenance for hardcoded APIs.
Flexibility: You may want to switch vendors, use fine-tuned models, or run them locally.
Optimizations: Prompt caching, batching, and streaming are easier to implement without vendor lock-in.
Implementing Utility Functions
When implementing utility functions for your BrainyFlow project:
Create a separate file for each utility function in the
utils/
directory.Include a simple test or example usage in each file.
Document the input/output and purpose of each utility function.
Example structure:
my_project/
├── utils/
│ ├── __init__.py
│ ├── call_llm.py
│ ├── search_web.py
│ └── embed_text.py
└── ...
By following this approach, you can easily maintain and update your utility functions as needed, without being constrained by the framework's built-in utilities.
Last updated