mirror of https://github.com/kortix-ai/suna.git
simplify further
This commit is contained in:
parent
301e486089
commit
037b3c7c72
|
@ -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'
|
||||
]
|
|
@ -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()
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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({
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Hello, world!
|
|
@ -0,0 +1 @@
|
|||
Random data for random times.
|
|
@ -0,0 +1 @@
|
|||
Call me Ishmael.
|
|
@ -0,0 +1 @@
|
|||
In randomness, we find creativity.
|
|
@ -0,0 +1 @@
|
|||
Randomness is the spice of life.
|
|
@ -0,0 +1 @@
|
|||
A random act of creation.
|
|
@ -0,0 +1 @@
|
|||
The quick brown fox jumps over the lazy dog.
|
|
@ -0,0 +1 @@
|
|||
Just another random file content!
|
|
@ -0,0 +1 @@
|
|||
All animals are equal, but some animals are more equal than others.
|
|
@ -0,0 +1 @@
|
|||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
@ -0,0 +1 @@
|
|||
Yet another example of random text.
|
|
@ -0,0 +1 @@
|
|||
In the end, we will remember not the words of our enemies, but the silence of our friends.
|
|
@ -0,0 +1 @@
|
|||
Elementary, my dear Watson.
|
|
@ -0,0 +1 @@
|
|||
This is a completely different random message.
|
|
@ -0,0 +1 @@
|
|||
It was a bright cold day in April, and the clocks were striking thirteen.
|
|
@ -0,0 +1 @@
|
|||
To be or not to be, that is the question.
|
|
@ -0,0 +1 @@
|
|||
Randomness is key to creativity!
|
|
@ -0,0 +1 @@
|
|||
A journey of a thousand miles begins with a single step.
|
|
@ -0,0 +1 @@
|
|||
I think, therefore I am.
|
|
@ -0,0 +1 @@
|
|||
All work and no play makes Jack a dull boy.
|
|
@ -0,0 +1 @@
|
|||
Exploring the depths of randomness.
|
|
@ -0,0 +1 @@
|
|||
The only thing we have to fear is fear itself.
|
|
@ -0,0 +1 @@
|
|||
Random thoughts in a random world.
|
|
@ -0,0 +1 @@
|
|||
Hello, world!
|
|
@ -0,0 +1 @@
|
|||
That's one small step for man, one giant leap for mankind.
|
|
@ -0,0 +1 @@
|
|||
The beauty of randomness lies in its unpredictability.
|
|
@ -0,0 +1 @@
|
|||
In the beginning, God created the heavens and the earth.
|
|
@ -0,0 +1 @@
|
|||
Embrace randomness for unique insights.
|
|
@ -0,0 +1 @@
|
|||
It was the best of times, it was the worst of times.
|
Loading…
Reference in New Issue