Skip to content

Commit

Permalink
update langchain modules (#2067)
Browse files Browse the repository at this point in the history
## Description

- **Summary of changes**: Describe the key changes in this PR and their
purpose.
- **Related issues**: Mention if this PR fixes or is connected to any
issues.
- **Motivation and context**: Explain the reason for the changes and the
problem they solve.
- **Environment or dependencies**: Specify any changes in dependencies
or environment configurations required for this update.
- **Impact on metrics**: (If applicable) Describe changes in any metrics
or performance benchmarks.

Fixes # (issue)

---

## Type of change

Please check the options that are relevant:

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Model update (Addition or modification of models)
- [ ] Other (please describe):

---

## Checklist

- [ ] Adherence to standards: Code complies with Agno’s style guidelines
and best practices.
- [ ] Formatting and validation: You have run `./scripts/format.sh` and
`./scripts/validate.sh` to ensure code is formatted and linted.
- [ ] Self-review completed: A thorough review has been performed by the
contributor(s).
- [ ] Documentation: Docstrings and comments have been added or updated
for any complex logic.
- [ ] Examples and guides: Relevant cookbook examples have been included
or updated (if applicable).
- [ ] Tested in a clean environment: Changes have been tested in a clean
environment to confirm expected behavior.
- [ ] Tests (optional): Tests have been added or updated to cover any
new or changed functionality.

---

## Additional Notes

Include any deployment notes, performance implications, security
considerations, or other relevant information (e.g., screenshots or logs
if applicable).
  • Loading branch information
pritipsingh authored Feb 10, 2025
1 parent 0fed66c commit 49dbea9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 8 additions & 5 deletions cookbook/agent_concepts/knowledge/langchain_kb.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Import necessary modules
"""
pip install langchain langchain-community langchain-openai langchain-chroma agno
"""

import pathlib

from agno.agent import Agent
from agno.knowledge.langchain import LangChainKnowledgeBase
from langchain.document_loaders import TextLoader
from langchain.embeddings import OpenAIEmbeddings
from langchain.text_splitter import CharacterTextSplitter
from langchain.vectorstores import Chroma
from langchain_chroma import Chroma
from langchain_community.document_loaders import TextLoader
from langchain_openai import OpenAIEmbeddings

# Define the directory where the Chroma database is located
chroma_db_dir = pathlib.Path("./chroma_db")
Expand Down Expand Up @@ -39,4 +42,4 @@
agent = Agent(knowledge=knowledge_base)

# Use the agent to ask a question and print a response.
agent.print_response("What did the president say about technology?", markdown=True)
agent.print_response("What did the president say?", markdown=True)
1 change: 0 additions & 1 deletion cookbook/agent_concepts/knowledge/llamaindex_kb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
Import necessary modules
pip install llama-index-core llama-index-readers-file llama-index-embeddings-openai agno
"""

Expand Down

0 comments on commit 49dbea9

Please sign in to comment.