Update crew.py
Browse files
crew.py
CHANGED
@@ -181,14 +181,15 @@ def run_crew(question, file_path):
|
|
181 |
raise RuntimeError(f"Processing failed: {str(e)}")
|
182 |
|
183 |
@tool("Code Execution Tool")
|
184 |
-
def code_execution_tool(file_path: str) -> str:
|
185 |
-
"""Execute a Python code file and
|
186 |
|
187 |
Args:
|
|
|
188 |
file_path (str): The Python code file path
|
189 |
|
190 |
Returns:
|
191 |
-
str:
|
192 |
|
193 |
Raises:
|
194 |
RuntimeError: If processing fails"""
|
@@ -199,7 +200,7 @@ def run_crew(question, file_path):
|
|
199 |
|
200 |
response = client.models.generate_content(
|
201 |
model=CODE_MODEL,
|
202 |
-
contents=[file],
|
203 |
config=types.GenerateContentConfig(
|
204 |
tools=[types.Tool(code_execution=types.ToolCodeExecution)]
|
205 |
),
|
|
|
181 |
raise RuntimeError(f"Processing failed: {str(e)}")
|
182 |
|
183 |
@tool("Code Execution Tool")
|
184 |
+
def code_execution_tool(question: str, file_path: str) -> str:
|
185 |
+
"""Execute a Python code file and answer a question about it.
|
186 |
|
187 |
Args:
|
188 |
+
question (str): Question about a Pyton code file
|
189 |
file_path (str): The Python code file path
|
190 |
|
191 |
Returns:
|
192 |
+
str: Answer to the question about the Python code file
|
193 |
|
194 |
Raises:
|
195 |
RuntimeError: If processing fails"""
|
|
|
200 |
|
201 |
response = client.models.generate_content(
|
202 |
model=CODE_MODEL,
|
203 |
+
contents=[file, question],
|
204 |
config=types.GenerateContentConfig(
|
205 |
tools=[types.Tool(code_execution=types.ToolCodeExecution)]
|
206 |
),
|