diff --git a/agentpress/__init__.py b/agentpress/__init__.py index 91db8fe2..70d30f8b 100644 --- a/agentpress/__init__.py +++ b/agentpress/__init__.py @@ -1,8 +1,6 @@ -from .config import settings from .llm import make_llm_api_call from .thread_manager import ThreadManager __all__ = [ - 'settings', 'make_llm_api_call', 'ThreadManager' ] \ No newline at end of file diff --git a/agentpress/config.py b/agentpress/config.py deleted file mode 100644 index 62d420c1..00000000 --- a/agentpress/config.py +++ /dev/null @@ -1,21 +0,0 @@ -import os -from pydantic_settings import BaseSettings -from typing import Optional - -class Settings(BaseSettings): - openai_api_key: Optional[str] = None - anthropic_api_key: Optional[str] = None - groq_api_key: Optional[str] = None - - dir_base_path: str = '' - workspace_dir: str = '' - - class Config: - env_file = ".env" - - def __init__(self, **values): - super().__init__(**values) - self.workspace_dir = os.path.join(self.dir_base_path, 'workspace') - os.makedirs(self.workspace_dir, exist_ok=True) - -settings = Settings() diff --git a/agentpress/llm.py b/agentpress/llm.py index 945d8910..bf316bba 100644 --- a/agentpress/llm.py +++ b/agentpress/llm.py @@ -6,17 +6,12 @@ import openai from openai import OpenAIError import asyncio import logging -from agentpress.config import settings # Import the settings - -# Import agentops import agentops -# Load environment variables -OPENAI_API_KEY = settings.openai_api_key -ANTHROPIC_API_KEY = settings.anthropic_api_key -GROQ_API_KEY = settings.groq_api_key +OPENAI_API_KEY = os.environ.get('OPENAI_API_KEY') +ANTHROPIC_API_KEY = os.environ.get('ANTHROPIC_API_KEY') +GROQ_API_KEY = os.environ.get('GROQ_API_KEY') -# Export environment variables os.environ['OPENAI_API_KEY'] = OPENAI_API_KEY os.environ['ANTHROPIC_API_KEY'] = ANTHROPIC_API_KEY os.environ['GROQ_API_KEY'] = GROQ_API_KEY diff --git a/agentpress/tool_registry.py b/agentpress/tool_registry.py index 8345c602..f1d15b2d 100644 --- a/agentpress/tool_registry.py +++ b/agentpress/tool_registry.py @@ -1,9 +1,6 @@ from typing import Dict, Type, Any, List, Optional from agentpress.tool import Tool -from agentpress.config import settings -import importlib.util -import os -import inspect + class ToolRegistry: def __init__(self): diff --git a/threads/090d0276-d592-4a55-b040-101c3a47ea48.json b/threads/090d0276-d592-4a55-b040-101c3a47ea48.json new file mode 100644 index 00000000..f3461dba --- /dev/null +++ b/threads/090d0276-d592-4a55-b040-101c3a47ea48.json @@ -0,0 +1 @@ +{"messages": [{"role": "user", "content": "Please create a file with a random name with the content 'Hello, world!'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_9hkKUTaTVid2Is7huIUf87K2", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\":\"random_file_123.txt\",\"content\":\"Hello, world!\"}"}}]}, {"role": "tool", "tool_call_id": "call_9hkKUTaTVid2Is7huIUf87K2", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_123.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_sPehmithBl5PzQaWFheckNV3", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_456.txt\", \"content\": \"This is a test file with some random content.\"}"}}, {"id": "call_f1g1MNFEhvwbROjAjRqLdCdS", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_789.txt\", \"content\": \"Another random content file for testing purposes.\"}"}}, {"id": "call_MZ5UlEUo7zmVKvMCwCmWpkl0", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_101112.txt\", \"content\": \"Yet another example of a random file with content.\"}"}}]}, {"role": "tool", "tool_call_id": "call_sPehmithBl5PzQaWFheckNV3", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_456.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_f1g1MNFEhvwbROjAjRqLdCdS", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_789.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_MZ5UlEUo7zmVKvMCwCmWpkl0", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_101112.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_5o5NRzkIjCBzNqKQ8JQsRwTz", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_131415.txt\", \"content\": \"Random content for a randomly named file.\"}"}}, {"id": "call_trOrUNFFkZ6Hy2PEssRfUYzC", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_161718.txt\", \"content\": \"This file contains some more random text.\"}"}}, {"id": "call_V7FpvP1QGzU77KOrR2Q0pMr0", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_192021.txt\", \"content\": \"Testing with yet another file and random content.\"}"}}]}, {"role": "tool", "tool_call_id": "call_5o5NRzkIjCBzNqKQ8JQsRwTz", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_131415.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_trOrUNFFkZ6Hy2PEssRfUYzC", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_161718.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_V7FpvP1QGzU77KOrR2Q0pMr0", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_192021.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_aW7YHdNpNOmBTFlNMQjFwbRT", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_222324.txt\", \"content\": \"Here is some more random content in a file with a random name.\"}"}}, {"id": "call_85tb2WmYu8q6YEpWxY6J6Ifr", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_252627.txt\", \"content\": \"Just another file with some random text inside.\"}"}}, {"id": "call_MZiUuCEvZ5sY6dP0IPyIm6a5", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_282930.txt\", \"content\": \"Randomness continues with this new file creation.\"}"}}]}, {"role": "tool", "tool_call_id": "call_aW7YHdNpNOmBTFlNMQjFwbRT", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_222324.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_85tb2WmYu8q6YEpWxY6J6Ifr", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_252627.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_MZiUuCEvZ5sY6dP0IPyIm6a5", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_282930.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_TFORVNSiipR1hSBwmtKgPGV4", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_313233.txt\", \"content\": \"Random content strikes again in this new file.\"}"}}, {"id": "call_ts7J44srIbuh6QVSb383yhiT", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_343536.txt\", \"content\": \"Yet another file filled with randomness.\"}"}}, {"id": "call_emObyZAs0L00WPCXyI5Jftge", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_373839.txt\", \"content\": \"File creation with random text is ongoing.\"}"}}]}, {"role": "tool", "tool_call_id": "call_TFORVNSiipR1hSBwmtKgPGV4", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_313233.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_ts7J44srIbuh6QVSb383yhiT", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_343536.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_emObyZAs0L00WPCXyI5Jftge", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_373839.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}]} \ No newline at end of file diff --git a/threads/34018815-21ef-40ae-ac70-11a370e07946.json b/threads/34018815-21ef-40ae-ac70-11a370e07946.json new file mode 100644 index 00000000..d399ce0d --- /dev/null +++ b/threads/34018815-21ef-40ae-ac70-11a370e07946.json @@ -0,0 +1 @@ +{"messages": [{"role": "user", "content": "Please create a file with a random name with the content 'Hello, world!'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_yX9fvmwQifvQ5iqL8ymHuCP1", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\":\"random_file_1.txt\",\"content\":\"Hello, world!\"}"}}]}, {"role": "tool", "tool_call_id": "call_yX9fvmwQifvQ5iqL8ymHuCP1", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_1.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_IJXU8SNLibATo7AjLkjxlrCL", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_2.txt\", \"content\": \"Just another random file content!\"}"}}, {"id": "call_em1O7w7X6GuwgaYG93CTcHiP", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_3.txt\", \"content\": \"Yet another example of random text.\"}"}}, {"id": "call_OxENXUsMhFNJAzJHrfiMHkpm", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_4.txt\", \"content\": \"This is a completely different random message.\"}"}}]}, {"role": "tool", "tool_call_id": "call_IJXU8SNLibATo7AjLkjxlrCL", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_2.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_em1O7w7X6GuwgaYG93CTcHiP", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_3.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_OxENXUsMhFNJAzJHrfiMHkpm", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_4.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_T5KACfqgFcgUfX6g3sH8qN3i", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_5.txt\", \"content\": \"Randomness is key to creativity!\"}"}}, {"id": "call_1j7KYbALsNwtc8YQwvpYSZmJ", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_6.txt\", \"content\": \"Exploring the depths of randomness.\"}"}}, {"id": "call_P7RgA5XeoKnIOoR07Qx0YDp7", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_7.txt\", \"content\": \"Random thoughts in a random world.\"}"}}]}, {"role": "tool", "tool_call_id": "call_T5KACfqgFcgUfX6g3sH8qN3i", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_5.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_1j7KYbALsNwtc8YQwvpYSZmJ", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_6.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_P7RgA5XeoKnIOoR07Qx0YDp7", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_7.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_P4eoDlJMeA8zvLiuhcrSNqsU", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_8.txt\", \"content\": \"The beauty of randomness lies in its unpredictability.\"}"}}, {"id": "call_g3FjALYNXdA89wKhZ7Lrx88A", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_9.txt\", \"content\": \"Embrace randomness for unique insights.\"}"}}, {"id": "call_4XStAE6OFs7QTFDg2nvfQsYx", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_10.txt\", \"content\": \"Random data for random times.\"}"}}]}, {"role": "tool", "tool_call_id": "call_P4eoDlJMeA8zvLiuhcrSNqsU", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_8.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_g3FjALYNXdA89wKhZ7Lrx88A", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_9.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_4XStAE6OFs7QTFDg2nvfQsYx", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_10.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_LPlux84zPN79Opvz8GPnHolh", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_11.txt\", \"content\": \"In randomness, we find creativity.\"}"}}, {"id": "call_ZdTOvByGFaRvEBivp5PLoiUU", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_12.txt\", \"content\": \"Randomness is the spice of life.\"}"}}, {"id": "call_GjtKyWjtaSH21dpEjVC7aHuP", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_13.txt\", \"content\": \"A random act of creation.\"}"}}]}, {"role": "tool", "tool_call_id": "call_LPlux84zPN79Opvz8GPnHolh", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_11.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_ZdTOvByGFaRvEBivp5PLoiUU", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_12.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_GjtKyWjtaSH21dpEjVC7aHuP", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_13.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}]} \ No newline at end of file diff --git a/threads/b4565452-4dfe-48a6-8fa9-8af6520f6bbf.json b/threads/b4565452-4dfe-48a6-8fa9-8af6520f6bbf.json new file mode 100644 index 00000000..d024c950 --- /dev/null +++ b/threads/b4565452-4dfe-48a6-8fa9-8af6520f6bbf.json @@ -0,0 +1 @@ +{"messages": [{"role": "user", "content": "Please create a file with a random name with the content 'Hello, world!'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_UcDDW088FJVd5YMOKPV1tymk", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\":\"random_file_7438.txt\",\"content\":\"Hello, world!\"}"}}]}, {"role": "tool", "tool_call_id": "call_UcDDW088FJVd5YMOKPV1tymk", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_7438.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_UNAAh3A2UCREbl0zlua7orcC", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_1837.txt\", \"content\": \"The quick brown fox jumps over the lazy dog.\"}"}}, {"id": "call_Zwfcbas7J8rwfz16I7w3u2gx", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_2893.txt\", \"content\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\"}"}}, {"id": "call_nP80AxT5QHTQO4TalU8zelw3", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_4765.txt\", \"content\": \"To be or not to be, that is the question.\"}"}}, {"id": "call_kDa5kGU5qk2tOkBSL7nun6xI", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_5921.txt\", \"content\": \"All work and no play makes Jack a dull boy.\"}"}}]}, {"role": "tool", "tool_call_id": "call_UNAAh3A2UCREbl0zlua7orcC", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_1837.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_Zwfcbas7J8rwfz16I7w3u2gx", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_2893.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_nP80AxT5QHTQO4TalU8zelw3", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_4765.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_kDa5kGU5qk2tOkBSL7nun6xI", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_5921.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_zXyz4DOMLnlS8Ve8wWbW18Vy", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_8129.txt\", \"content\": \"In the beginning, God created the heavens and the earth.\"}"}}, {"id": "call_r5XPguRSso3Ro5kfdbny9Wva", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_9374.txt\", \"content\": \"It was the best of times, it was the worst of times.\"}"}}, {"id": "call_IwCS7IT0CYCL2bbLkl83vrUh", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_1045.txt\", \"content\": \"Call me Ishmael.\"}"}}, {"id": "call_Z9jVnkIjExUPD9Wwbv0EUE8O", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_5218.txt\", \"content\": \"A journey of a thousand miles begins with a single step.\"}"}}]}, {"role": "tool", "tool_call_id": "call_zXyz4DOMLnlS8Ve8wWbW18Vy", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_8129.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_r5XPguRSso3Ro5kfdbny9Wva", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_9374.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_IwCS7IT0CYCL2bbLkl83vrUh", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_1045.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_Z9jVnkIjExUPD9Wwbv0EUE8O", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_5218.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_3krVvv568YOk5iL2cpSxVQGX", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_2376.txt\", \"content\": \"All animals are equal, but some animals are more equal than others.\"}"}}, {"id": "call_18R0VMWzgM08NRMqtyJ9WHmd", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_3482.txt\", \"content\": \"Elementary, my dear Watson.\"}"}}, {"id": "call_YuMWNrS9zTbPwYF1HArRS7Kg", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_4591.txt\", \"content\": \"It was a bright cold day in April, and the clocks were striking thirteen.\"}"}}, {"id": "call_oZ0UPNpSXAkadAVKhY85LxuC", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_5714.txt\", \"content\": \"I think, therefore I am.\"}"}}]}, {"role": "tool", "tool_call_id": "call_3krVvv568YOk5iL2cpSxVQGX", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_2376.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_18R0VMWzgM08NRMqtyJ9WHmd", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_3482.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_YuMWNrS9zTbPwYF1HArRS7Kg", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_4591.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_oZ0UPNpSXAkadAVKhY85LxuC", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_5714.txt' created successfully.\")"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_8jgipcuHOlp7gXbDr7ImjDd7", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_6823.txt\", \"content\": \"The only thing we have to fear is fear itself.\"}"}}, {"id": "call_xMXnHaxhmfzJNTi1LWiHUrSv", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_7945.txt\", \"content\": \"That's one small step for man, one giant leap for mankind.\"}"}}, {"id": "call_caGXHBZIltOeyATtweWLtH3T", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_3051.txt\", \"content\": \"In the end, we will remember not the words of our enemies, but the silence of our friends.\"}"}}, {"id": "call_cz6YzuwtKqP59OJ9EFJ6EMVp", "type": "function", "function": {"name": "create_file", "arguments": "{\"file_path\": \"random_file_4167.txt\", \"content\": null}"}}]}, {"role": "tool", "tool_call_id": "call_8jgipcuHOlp7gXbDr7ImjDd7", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_6823.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_xMXnHaxhmfzJNTi1LWiHUrSv", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_7945.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_caGXHBZIltOeyATtweWLtH3T", "name": "create_file", "content": "ToolResult(success=True, output=\"File 'random_file_3051.txt' created successfully.\")"}, {"role": "tool", "tool_call_id": "call_cz6YzuwtKqP59OJ9EFJ6EMVp", "name": "create_file", "content": "ToolResult(success=False, output='Error creating file: write() argument must be str, not None')"}, {"role": "user", "content": "CREATE MORE RANDOM FILES WITH RANDOM CONTENTS. JSUT CREATE IT \u2013 NO QUESTINS PLEASE.'"}]} \ No newline at end of file diff --git a/tools/files_tool.py b/tools/files_tool.py index 8209ed9f..7d2ed30d 100644 --- a/tools/files_tool.py +++ b/tools/files_tool.py @@ -2,12 +2,11 @@ import os import asyncio from typing import Dict, Any from agentpress.tool import Tool, ToolResult, tool_schema -from agentpress.config import settings class FilesTool(Tool): def __init__(self): super().__init__() - self.workspace = settings.workspace_dir + self.workspace = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'workspace') os.makedirs(self.workspace, exist_ok=True) @tool_schema({ diff --git a/workspace/random_file_1.txt b/workspace/random_file_1.txt new file mode 100644 index 00000000..5dd01c17 --- /dev/null +++ b/workspace/random_file_1.txt @@ -0,0 +1 @@ +Hello, world! \ No newline at end of file diff --git a/workspace/random_file_10.txt b/workspace/random_file_10.txt new file mode 100644 index 00000000..9f4555a3 --- /dev/null +++ b/workspace/random_file_10.txt @@ -0,0 +1 @@ +Random data for random times. \ No newline at end of file diff --git a/workspace/random_file_1045.txt b/workspace/random_file_1045.txt new file mode 100644 index 00000000..ce2d5f6e --- /dev/null +++ b/workspace/random_file_1045.txt @@ -0,0 +1 @@ +Call me Ishmael. \ No newline at end of file diff --git a/workspace/random_file_11.txt b/workspace/random_file_11.txt new file mode 100644 index 00000000..37f4bcd0 --- /dev/null +++ b/workspace/random_file_11.txt @@ -0,0 +1 @@ +In randomness, we find creativity. \ No newline at end of file diff --git a/workspace/random_file_12.txt b/workspace/random_file_12.txt new file mode 100644 index 00000000..3a77fce6 --- /dev/null +++ b/workspace/random_file_12.txt @@ -0,0 +1 @@ +Randomness is the spice of life. \ No newline at end of file diff --git a/workspace/random_file_13.txt b/workspace/random_file_13.txt new file mode 100644 index 00000000..d8f93a21 --- /dev/null +++ b/workspace/random_file_13.txt @@ -0,0 +1 @@ +A random act of creation. \ No newline at end of file diff --git a/workspace/random_file_1837.txt b/workspace/random_file_1837.txt new file mode 100644 index 00000000..8fe2a4b5 --- /dev/null +++ b/workspace/random_file_1837.txt @@ -0,0 +1 @@ +The quick brown fox jumps over the lazy dog. \ No newline at end of file diff --git a/workspace/random_file_2.txt b/workspace/random_file_2.txt new file mode 100644 index 00000000..a602466b --- /dev/null +++ b/workspace/random_file_2.txt @@ -0,0 +1 @@ +Just another random file content! \ No newline at end of file diff --git a/workspace/random_file_2376.txt b/workspace/random_file_2376.txt new file mode 100644 index 00000000..be4e0d7c --- /dev/null +++ b/workspace/random_file_2376.txt @@ -0,0 +1 @@ +All animals are equal, but some animals are more equal than others. \ No newline at end of file diff --git a/workspace/random_file_2893.txt b/workspace/random_file_2893.txt new file mode 100644 index 00000000..d8634396 --- /dev/null +++ b/workspace/random_file_2893.txt @@ -0,0 +1 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit. \ No newline at end of file diff --git a/workspace/random_file_3.txt b/workspace/random_file_3.txt new file mode 100644 index 00000000..778f3cc7 --- /dev/null +++ b/workspace/random_file_3.txt @@ -0,0 +1 @@ +Yet another example of random text. \ No newline at end of file diff --git a/workspace/random_file_3051.txt b/workspace/random_file_3051.txt new file mode 100644 index 00000000..eb484eb3 --- /dev/null +++ b/workspace/random_file_3051.txt @@ -0,0 +1 @@ +In the end, we will remember not the words of our enemies, but the silence of our friends. \ No newline at end of file diff --git a/workspace/random_file_3482.txt b/workspace/random_file_3482.txt new file mode 100644 index 00000000..75756645 --- /dev/null +++ b/workspace/random_file_3482.txt @@ -0,0 +1 @@ +Elementary, my dear Watson. \ No newline at end of file diff --git a/workspace/random_file_4.txt b/workspace/random_file_4.txt new file mode 100644 index 00000000..2c201974 --- /dev/null +++ b/workspace/random_file_4.txt @@ -0,0 +1 @@ +This is a completely different random message. \ No newline at end of file diff --git a/workspace/random_file_4167.txt b/workspace/random_file_4167.txt new file mode 100644 index 00000000..e69de29b diff --git a/workspace/random_file_4591.txt b/workspace/random_file_4591.txt new file mode 100644 index 00000000..2703b3bb --- /dev/null +++ b/workspace/random_file_4591.txt @@ -0,0 +1 @@ +It was a bright cold day in April, and the clocks were striking thirteen. \ No newline at end of file diff --git a/workspace/random_file_4765.txt b/workspace/random_file_4765.txt new file mode 100644 index 00000000..086921d4 --- /dev/null +++ b/workspace/random_file_4765.txt @@ -0,0 +1 @@ +To be or not to be, that is the question. \ No newline at end of file diff --git a/workspace/random_file_5.txt b/workspace/random_file_5.txt new file mode 100644 index 00000000..90dbf6f7 --- /dev/null +++ b/workspace/random_file_5.txt @@ -0,0 +1 @@ +Randomness is key to creativity! \ No newline at end of file diff --git a/workspace/random_file_5218.txt b/workspace/random_file_5218.txt new file mode 100644 index 00000000..c69dbeee --- /dev/null +++ b/workspace/random_file_5218.txt @@ -0,0 +1 @@ +A journey of a thousand miles begins with a single step. \ No newline at end of file diff --git a/workspace/random_file_5714.txt b/workspace/random_file_5714.txt new file mode 100644 index 00000000..02ff3a35 --- /dev/null +++ b/workspace/random_file_5714.txt @@ -0,0 +1 @@ +I think, therefore I am. \ No newline at end of file diff --git a/workspace/random_file_5921.txt b/workspace/random_file_5921.txt new file mode 100644 index 00000000..b93a0a47 --- /dev/null +++ b/workspace/random_file_5921.txt @@ -0,0 +1 @@ +All work and no play makes Jack a dull boy. \ No newline at end of file diff --git a/workspace/random_file_6.txt b/workspace/random_file_6.txt new file mode 100644 index 00000000..901dd230 --- /dev/null +++ b/workspace/random_file_6.txt @@ -0,0 +1 @@ +Exploring the depths of randomness. \ No newline at end of file diff --git a/workspace/random_file_6823.txt b/workspace/random_file_6823.txt new file mode 100644 index 00000000..fdf988a9 --- /dev/null +++ b/workspace/random_file_6823.txt @@ -0,0 +1 @@ +The only thing we have to fear is fear itself. \ No newline at end of file diff --git a/workspace/random_file_7.txt b/workspace/random_file_7.txt new file mode 100644 index 00000000..4339c166 --- /dev/null +++ b/workspace/random_file_7.txt @@ -0,0 +1 @@ +Random thoughts in a random world. \ No newline at end of file diff --git a/workspace/random_file_7438.txt b/workspace/random_file_7438.txt new file mode 100644 index 00000000..5dd01c17 --- /dev/null +++ b/workspace/random_file_7438.txt @@ -0,0 +1 @@ +Hello, world! \ No newline at end of file diff --git a/workspace/random_file_7945.txt b/workspace/random_file_7945.txt new file mode 100644 index 00000000..d250fe86 --- /dev/null +++ b/workspace/random_file_7945.txt @@ -0,0 +1 @@ +That's one small step for man, one giant leap for mankind. \ No newline at end of file diff --git a/workspace/random_file_8.txt b/workspace/random_file_8.txt new file mode 100644 index 00000000..68a7f3d8 --- /dev/null +++ b/workspace/random_file_8.txt @@ -0,0 +1 @@ +The beauty of randomness lies in its unpredictability. \ No newline at end of file diff --git a/workspace/random_file_8129.txt b/workspace/random_file_8129.txt new file mode 100644 index 00000000..8d0f5b04 --- /dev/null +++ b/workspace/random_file_8129.txt @@ -0,0 +1 @@ +In the beginning, God created the heavens and the earth. \ No newline at end of file diff --git a/workspace/random_file_9.txt b/workspace/random_file_9.txt new file mode 100644 index 00000000..3c4685af --- /dev/null +++ b/workspace/random_file_9.txt @@ -0,0 +1 @@ +Embrace randomness for unique insights. \ No newline at end of file diff --git a/workspace/random_file_9374.txt b/workspace/random_file_9374.txt new file mode 100644 index 00000000..32ae2e74 --- /dev/null +++ b/workspace/random_file_9374.txt @@ -0,0 +1 @@ +It was the best of times, it was the worst of times. \ No newline at end of file