simplify further

This commit is contained in:
marko-kraemer 2024-10-23 04:23:50 +02:00
parent 301e486089
commit 037b3c7c72
38 changed files with 37 additions and 37 deletions

View File

@ -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'
]

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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({

View File

@ -0,0 +1 @@
Hello, world!

View File

@ -0,0 +1 @@
Random data for random times.

View File

@ -0,0 +1 @@
Call me Ishmael.

View File

@ -0,0 +1 @@
In randomness, we find creativity.

View File

@ -0,0 +1 @@
Randomness is the spice of life.

View File

@ -0,0 +1 @@
A random act of creation.

View File

@ -0,0 +1 @@
The quick brown fox jumps over the lazy dog.

View File

@ -0,0 +1 @@
Just another random file content!

View File

@ -0,0 +1 @@
All animals are equal, but some animals are more equal than others.

View File

@ -0,0 +1 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

View File

@ -0,0 +1 @@
Yet another example of random text.

View File

@ -0,0 +1 @@
In the end, we will remember not the words of our enemies, but the silence of our friends.

View File

@ -0,0 +1 @@
Elementary, my dear Watson.

View File

@ -0,0 +1 @@
This is a completely different random message.

View File

View File

@ -0,0 +1 @@
It was a bright cold day in April, and the clocks were striking thirteen.

View File

@ -0,0 +1 @@
To be or not to be, that is the question.

View File

@ -0,0 +1 @@
Randomness is key to creativity!

View File

@ -0,0 +1 @@
A journey of a thousand miles begins with a single step.

View File

@ -0,0 +1 @@
I think, therefore I am.

View File

@ -0,0 +1 @@
All work and no play makes Jack a dull boy.

View File

@ -0,0 +1 @@
Exploring the depths of randomness.

View File

@ -0,0 +1 @@
The only thing we have to fear is fear itself.

View File

@ -0,0 +1 @@
Random thoughts in a random world.

View File

@ -0,0 +1 @@
Hello, world!

View File

@ -0,0 +1 @@
That's one small step for man, one giant leap for mankind.

View File

@ -0,0 +1 @@
The beauty of randomness lies in its unpredictability.

View File

@ -0,0 +1 @@
In the beginning, God created the heavens and the earth.

View File

@ -0,0 +1 @@
Embrace randomness for unique insights.

View File

@ -0,0 +1 @@
It was the best of times, it was the worst of times.