mirror of
https://github.com/agno-agi/agno.git
synced 2026-10-11 22:09:58 +00:00
# Changelog
This is a major refactor to be coupled with the launch of Agno AI.
## Interface Changes:
- `phi.model.x` → `agno.models.x`
- `phi.knowledge_base.x` → `agno.knowledge.x` (applies to all knowledge
bases)
- `phi.document.reader.xxx` → `agno.document.reader.xxx_reader` (applies
to all document readers)
- All Agno toolkits are now suffixed with `Tools`. E.g. `DuckDuckGo` →
`DuckDuckGoTools`
- Multi-modal interface updates:
- `agent.run(images=[])` and `agent.print_response(images=[])` is now of
type `Image`
```python
class Image(BaseModel):
url: Optional[str] = None # Remote location for image
filepath: Optional[Union[Path, str]] = None # Absolute local location
for image
content: Optional[Any] = None # Actual image bytes content
detail: Optional[str] = None # low, medium, high or auto (per OpenAI
spec
https://platform.openai.com/docs/guides/vision?lang=node#low-or-high-fidelity-image-understanding)
id: Optional[str] = None
```
- `agent.run(audio=[])` and `agent.print_response(audio=[])` is now of
type `Audio`
```python
class Audio(BaseModel):
filepath: Optional[Union[Path, str]] = None # Absolute local location
for audio
content: Optional[Any] = None # Actual audio bytes content
format: Optional[str] = None
```
- `agent.run(video=[])` and `agent.print_response(video=[])` is now of
type `Video`
```python
class Video(BaseModel):
filepath: Optional[Union[Path, str]] = None # Absolute local location
for video
content: Optional[Any] = None # Actual video bytes content
```
- `RunResponse.images` is now a list of type `ImageArtifact`
```python
class ImageArtifact(Media):
id: str
url: str # Remote location for file
alt_text: Optional[str] = None
```
- `RunResponse.audio` is now a list of type `AudioArtifact`
```python
class AudioArtifact(Media):
id: str
url: Optional[str] = None # Remote location for file
base64_audio: Optional[str] = None # Base64-encoded audio data
length: Optional[str] = None
mime_type: Optional[str] = None
```
- `RunResponse.videos` is now a list of type `VideoArtifact`
```python
class VideoArtifact(Media):
id: str
url: str # Remote location for file
eta: Optional[str] = None
length: Optional[str] = None
```
- `RunResponse.response_audio` is now of type `AudioOutput`
```python
class AudioOutput(BaseModel):
id: str
content: str # Base64 encoded
expires_at: int
transcript: str
```
- Models:
- `Hermes` → `OllamaHermes`
- `AzureOpenAIChat` → `AzureOpenAI`
- `CohereChat` → `Cohere`
- `DeepSeekChat` → `DeepSeek`
- `GeminiOpenAIChat` → `GeminiOpenAI`
- `HuggingFaceChat` → `HuggingFace`
- Embedders now all take `id` instead of `model` as a parameter. For
example
```python
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
knowledge_base = PDFUrlKnowledgeBase(
urls=["https://phi-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf"],
vector_db=PgVector(
table_name="recipes",
db_url=db_url,
embedder=OllamaEmbedder(id="llama3.2", dimensions=3072),
),
)
knowledge_base.load(recreate=True)
```
- Agent Storage class
- `PgAgentStorage` → `PostgresAgentStorage`
- `SqlAgentStorage` → `SqliteAgentStorage`
- `MongoAgentStorage` → `MongoDbAgentStorage`
- `S2AgentStorage` → `SingleStoreAgentStorage`
- Workflow Storage class
- `SqlWorkflowStorage` → `SqliteWorkflowStorage`
- `PgWorkflowStorage` → `PostgresWorkflowStorage`
- `MongoWorkflowStorage` → `MongoDbWorkflowStorage`
- Knowledge Base
- `phi.knowledge.pdf.PDFUrlKnowledgeBase` →
`agno.knowledge.pdf_url.PDFUrlKnowledgeBase`
- `phi.knowledge.csv.CSVUrlKnowledgeBase` →
`agno.knowledge.csv_url.CSVUrlKnowledgeBase`
- Readers
- `phi.document.reader.arxiv` → `agno.document.reader.arxiv_reader`
- `phi.document.reader.docx` → `agno.document.reader.docx_reader`
- `phi.document.reader.json` → `agno.document.reader.json_reader`
- `phi.document.reader.pdf` → `agno.document.reader.pdf_reader`
- `phi.document.reader.s3.pdf` → `agno.document.reader.s3.pdf_reader`
- `phi.document.reader.s3.text` → `agno.document.reader.s3.text_reader`
- `phi.document.reader.text` → `agno.document.reader.text_reader`
- `phi.document.reader.website` → `agno.document.reader.website_reader`
## Improvements:
- **Dataclasses** - Changed various instances of Pydantic models to
dataclasses to improve the speed.
## Removals
- Removed all references to `Assistant`
- Removed all references to `llm`
- Removed the `PhiTools` tool
- …
## Bug Fixes:
- Fixed semantic chunking by replacing `similarity_threshold` param with
`threshold` param
---------
Co-authored-by: Ashpreet <[email protected]>
Co-authored-by: Yash Pratap Solanky <[email protected]>
Co-authored-by: Willem Carel de Jongh <[email protected]>
Co-authored-by: Anurag <[email protected]>
Co-authored-by: Ayush <[email protected]>
Co-authored-by: Manthan Gupta <[email protected]>
Co-authored-by: ysolanky <[email protected]>
Co-authored-by: ansub <[email protected]>
Co-authored-by: Manthan Gupta <[email protected]>
46 lines
1.3 KiB
Bash
Executable File
46 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
############################################################################
|
|
# Agno Setup for running cookbooks
|
|
# - Create a virtual environment and install libraries in editable mode.
|
|
# - Please deactivate the existing virtual environment before running.
|
|
# Usage: ./scripts/cookbook_setup.sh
|
|
############################################################################
|
|
|
|
CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_ROOT="$(dirname "${CURR_DIR}")"
|
|
AGNO_DIR="${REPO_ROOT}/libs/agno"
|
|
source "${CURR_DIR}/_utils.sh"
|
|
|
|
VENV_DIR="${REPO_ROOT}/agnoenv"
|
|
PYTHON_VERSION=$(python3 --version)
|
|
|
|
print_heading "Development setup..."
|
|
|
|
print_heading "Removing virtual env"
|
|
print_info "rm -rf ${VENV_DIR}"
|
|
rm -rf ${VENV_DIR}
|
|
|
|
print_heading "Creating virtual env"
|
|
print_info "Creating python3 venv: ${VENV_DIR}"
|
|
python3 -m venv "${VENV_DIR}"
|
|
|
|
# Activate the venv
|
|
source "${VENV_DIR}/bin/activate"
|
|
|
|
print_info "Installing base python packages"
|
|
pip3 install --upgrade pip pip-tools twine build
|
|
|
|
print_heading "Installing requirements.txt"
|
|
pip install --no-deps \
|
|
-r ${AGNO_DIR}/requirements.txt
|
|
|
|
print_heading "Installing agno with [dev] extras"
|
|
pip install --editable "${AGNO_DIR}[dev]"
|
|
|
|
print_heading "pip list"
|
|
pip list
|
|
|
|
print_heading "Development setup complete"
|
|
print_heading "Activate venv using: source ${VENV_DIR}/bin/activate"
|