Spaces:
Sleeping
Sleeping
Commit ·
24bf56c
1
Parent(s): aacc053
Final
Browse files
Dockerfile
CHANGED
|
@@ -32,7 +32,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 32 |
|
| 33 |
RUN chmod +x /usr/local/bin/entrypoint.sh
|
| 34 |
|
| 35 |
-
RUN chmod -R 777 /app/.
|
| 36 |
|
| 37 |
USER ollama
|
| 38 |
|
|
|
|
| 32 |
|
| 33 |
RUN chmod +x /usr/local/bin/entrypoint.sh
|
| 34 |
|
| 35 |
+
RUN chmod -R 777 /app/.local /app/.ollama
|
| 36 |
|
| 37 |
USER ollama
|
| 38 |
|
src/codeagent/src/codeagent/crews/SqlCrew/sqlcrew.py
CHANGED
|
@@ -16,16 +16,6 @@ llm = LLM(model="ollama/llama3.1:8b-instruct-q4_0", base_url="http://localhost:1
|
|
| 16 |
def send_chat_message(output: str) -> None:
|
| 17 |
socketio.emit("event", {'kind':'agent_message', 'output': output})
|
| 18 |
|
| 19 |
-
def callback_function(output: TaskOutput):
|
| 20 |
-
# Do something after the task is completed
|
| 21 |
-
# Example: Send an email to the manager
|
| 22 |
-
socketio.emit("event", {'kind':'agent_message', 'output': output})
|
| 23 |
-
print(f"""
|
| 24 |
-
Task completed!
|
| 25 |
-
Task: {output.description}
|
| 26 |
-
Output: {output.raw}
|
| 27 |
-
""")
|
| 28 |
-
|
| 29 |
@CrewBase
|
| 30 |
class SqlCrew:
|
| 31 |
agents: List[BaseAgent]
|
|
@@ -59,7 +49,6 @@ class SqlCrew:
|
|
| 59 |
llm=llm,
|
| 60 |
tools=[get_files_and_schema],
|
| 61 |
allow_delegation=True,
|
| 62 |
-
step_callback = send_chat_message,
|
| 63 |
verbose=True
|
| 64 |
)
|
| 65 |
|
|
@@ -76,7 +65,6 @@ class SqlCrew:
|
|
| 76 |
llm=llm,
|
| 77 |
tools=[propose_code_changes, get_files_and_schema],
|
| 78 |
allow_delegation=True,
|
| 79 |
-
step_callback = send_chat_message,
|
| 80 |
verbose=True,
|
| 81 |
)
|
| 82 |
|
|
@@ -93,7 +81,6 @@ class SqlCrew:
|
|
| 93 |
llm=llm,
|
| 94 |
tools=[get_recent_query_result, get_files_and_schema],
|
| 95 |
allow_delegation=True,
|
| 96 |
-
step_callback = send_chat_message,
|
| 97 |
verbose=True,
|
| 98 |
)
|
| 99 |
|
|
@@ -111,7 +98,6 @@ class SqlCrew:
|
|
| 111 |
llm=llm,
|
| 112 |
tools=[execute_sql_file, get_files_and_schema],
|
| 113 |
allow_delegation=True,
|
| 114 |
-
step_callback = send_chat_message,
|
| 115 |
verbose=True,
|
| 116 |
)
|
| 117 |
|
|
@@ -129,7 +115,6 @@ class SqlCrew:
|
|
| 129 |
description="Propose schema (tables, columns, PKs, FKs) if needed meaning if user specifically said so to create database or to change database.",
|
| 130 |
expected_output="Schema design in text format.",
|
| 131 |
agent=self.schema_agent(),
|
| 132 |
-
callable = callback_function
|
| 133 |
)
|
| 134 |
|
| 135 |
@task
|
|
@@ -164,8 +149,6 @@ class SqlCrew:
|
|
| 164 |
tasks=self.tasks,
|
| 165 |
process=Process.hierarchical,
|
| 166 |
manager_llm = llm,
|
| 167 |
-
verbose=True
|
| 168 |
-
step_callback=send_chat_message,
|
| 169 |
-
task_callback=send_chat_message,
|
| 170 |
|
| 171 |
)
|
|
|
|
| 16 |
def send_chat_message(output: str) -> None:
|
| 17 |
socketio.emit("event", {'kind':'agent_message', 'output': output})
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
@CrewBase
|
| 20 |
class SqlCrew:
|
| 21 |
agents: List[BaseAgent]
|
|
|
|
| 49 |
llm=llm,
|
| 50 |
tools=[get_files_and_schema],
|
| 51 |
allow_delegation=True,
|
|
|
|
| 52 |
verbose=True
|
| 53 |
)
|
| 54 |
|
|
|
|
| 65 |
llm=llm,
|
| 66 |
tools=[propose_code_changes, get_files_and_schema],
|
| 67 |
allow_delegation=True,
|
|
|
|
| 68 |
verbose=True,
|
| 69 |
)
|
| 70 |
|
|
|
|
| 81 |
llm=llm,
|
| 82 |
tools=[get_recent_query_result, get_files_and_schema],
|
| 83 |
allow_delegation=True,
|
|
|
|
| 84 |
verbose=True,
|
| 85 |
)
|
| 86 |
|
|
|
|
| 98 |
llm=llm,
|
| 99 |
tools=[execute_sql_file, get_files_and_schema],
|
| 100 |
allow_delegation=True,
|
|
|
|
| 101 |
verbose=True,
|
| 102 |
)
|
| 103 |
|
|
|
|
| 115 |
description="Propose schema (tables, columns, PKs, FKs) if needed meaning if user specifically said so to create database or to change database.",
|
| 116 |
expected_output="Schema design in text format.",
|
| 117 |
agent=self.schema_agent(),
|
|
|
|
| 118 |
)
|
| 119 |
|
| 120 |
@task
|
|
|
|
| 149 |
tasks=self.tasks,
|
| 150 |
process=Process.hierarchical,
|
| 151 |
manager_llm = llm,
|
| 152 |
+
verbose=True
|
|
|
|
|
|
|
| 153 |
|
| 154 |
)
|