Extracted developer prompt and fixed log tool file location

This commit is contained in:
2024-08-17 17:53:25 -05:00
parent 76b4dce472
commit 27048302db
4 changed files with 25 additions and 44 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ class LogTool(BaseTool):
return error_message
def _get_log_contents(self, line_count=None):
log_file_path = 'tools/tool_output.log'
log_file_path = 'logs/output.log'
if not os.path.exists(log_file_path):
error_message = "Log file does not exist."
-25
View File
@@ -1,25 +0,0 @@
# tools/weather_tool.py
from .base_tool import BaseTool
class WeatherTool(BaseTool):
def get_functions(self):
return [{
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": ["location"]
}
}]
def execute(self, function_name, **kwargs):
if function_name == "get_weather":
location = kwargs.get("location")
# In a real implementation, you would call a weather API here
return f"The weather in {location} is sunny and 72°F"