-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoder.py
More file actions
86 lines (75 loc) · 2.89 KB
/
coder.py
File metadata and controls
86 lines (75 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
from agno.models.ollama.chat import Ollama
from agno.agent.agent import Agent
from agno.models.groq import Groq
from agno.tools.googlesearch import GoogleSearchTools
from agno.models.google import Gemini
from agno.tools import Toolkit
import os
import subprocess
from agno.tools.python import PythonTools
from agno.tools.shell import ShellTools
from agno.utils.log import logger
from typing import List
from linkedin_tools import linkedin_search_tool
from dotenv import load_dotenv
from code_tools import TerminalTools
load_dotenv()
GROQ_API_KEY = os.getenv("GROQ_API_KEY")
AGNO_API_KEY = os.getenv("AGNO_API_KEY")
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
#groq = Groq(id="llama-3.3-70b-versatile")
groq = Gemini(id="gemini-2.0-flash-exp")
# toolkit = Toolkit(tools=[ShellTools(), run_terminal_command])
computer_agent = Agent(
name = "Terminal Agent",
model=groq,
role = 'Use the terminal to navigate through the computer',
instructions=["convert requested task into a terminal command","Only create commands with respect to Linux","explore the folders thoroghly to run the relavant commands"],
tools=[TerminalTools()],
show_tool_calls=True,
markdown=True
)
browser = Agent(
name="Online browser",
model = groq,
role="Search the web for anything needed",
instructions=["make sure the answer is relavent to the query","Use judgement to make sure the right responses are returned"],
tools=[GoogleSearchTools()],
show_tool_calls=True,
markdown=True,
)
coding_agent = Agent(
name = "Code Generator",
model=groq,
team=[browser, computer_agent],
role = 'Created the requested code',
instructions=["Create the requested code", "code should be directly be able to run properly", "dont run the code"],
show_tool_calls=True,
markdown=True
)
linkedin = Agent(
model=Gemini(id="gemini-2.0-flash-exp", search=False),
role='search linkedin profiles to filter data',
instructions=["Use the tool to find the profiles by collecting profiles","Query using linkedin Boolean search"],
tools=[linkedin_search_tool],
show_tool_calls=True,
markdown=True,
)
sde = Agent(
team=[coding_agent,computer_agent, browser],
model=groq,
role='You are a software developer to create software projects',
add_history_to_messages=True,
num_history_responses=8,
read_tool_call_history=True,
instructions=["Interact with terminal to create and edit files and folders of a project", "Write coherent code with respect to the whole project","Dont run the code"],
show_tool_calls=True,
markdown=True,
debug_mode=True
)
if __name__ == '__main__':
msg = ''
while msg != 'bye':
msg = input('You: ')
sde.print_response(msg, stream=False, show_message=True)
# run_terminal_command("args=['echo', 'Write the above content to the readme.md file in the visiontransformer folder.', '>', 'visiontransformer/readme.md']")