chore: Updated the structure

This commit is contained in:
ShubhamSaboo
2024-11-04 20:59:39 -06:00
parent 1d0b44068e
commit 1a8f4fdb30
113 changed files with 62 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,19 @@
from phi.agent import Agent
from phi.model.openai import OpenAIChat
from phi.cli.console import console
regular_agent = Agent(model=OpenAIChat(id="gpt-4o-mini"), markdown=True)
reasoning_agent = Agent(
model=OpenAIChat(id="gpt-4o"),
reasoning=True,
markdown=True,
structured_outputs=True,
)
task = "How many 'r' are in the word 'supercalifragilisticexpialidocious'?"
console.rule("[bold green]Regular Agent[/bold green]")
regular_agent.print_response(task, stream=True)
console.rule("[bold yellow]Reasoning Agent[/bold yellow]")
reasoning_agent.print_response(task, stream=True, show_full_reasoning=True)

View File

@@ -0,0 +1,36 @@
from phi.agent import Agent
from phi.model.openai import OpenAIChat
from phi.knowledge.pdf import PDFKnowledgeBase, PDFReader
from phi.vectordb.lancedb import LanceDb, SearchType
from phi.playground import Playground, serve_playground_app
from phi.tools.duckduckgo import DuckDuckGo
# Set up configurations
DB_URI = "tmp/legal_docs_db"
# Create a knowledge base for legal documents
knowledge_base = PDFKnowledgeBase(
path="tmp/legal_docs",
vector_db=LanceDb(
table_name="legal_documents",
uri=DB_URI,
search_type=SearchType.vector
),
reader=PDFReader(chunk=True),
num_documents=5
)
# Create the agent
agent = Agent(
model=OpenAIChat(id="gpt-4"),
agent_id="legal-analysis-agent",
knowledge=knowledge_base,
tools=[DuckDuckGo()],
show_tool_calls=True,
markdown=True,
)
app = Playground(agents=[agent]).get_app()
if __name__ == "__main__":
serve_playground_app("legal_agent:app", reload=True)

View File

@@ -0,0 +1,7 @@
streamlit
phidata
openai
lancedb
tantivy
pypdf
duckduckgo-search

Some files were not shown because too many files have changed in this diff Show More