update config

This commit is contained in:
csunny 2023-05-09 00:15:19 +08:00
parent 8af4f5e378
commit 9e7a68349a
4 changed files with 59 additions and 7 deletions

View File

@ -2,14 +2,34 @@
# -*- coding:utf-8 -*-
from pilot.singleton import Singleton
from pilot.configs.config import Config
class AgentManager(metaclass=Singleton):
"""Agent manager for managing DB-GPT agents"""
def __init__(self) -> None:
self.agents = {} #TODO need to define
"""Agent manager for managing DB-GPT agents
In order to compatible auto gpt plugins,
we use the same template with it.
Args: next_keys
agents
cfg
"""
def create_agent(self):
def __init__(self) -> None:
self.next_key = 0
self.agents = {} #TODO need to define
self.cfg = Config()
def create_agent(self, task: str, prompt: str, model: str) -> tuple[int, str]:
"""Create a new agent and return its key
Args:
task: The task to perform
prompt: The prompt to use
model: The model to use
Returns:
The key of the new agent
"""
pass
def message_agent(self):

View File

@ -1,6 +1,9 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from typing import List
from auto_gpt_plugin_template import AutoGPTPluginTemplate
from pilot.singleton import Singleton
@ -8,7 +11,22 @@ class Config(metaclass=Singleton):
"""Configuration class to store the state of bools for different scripts access"""
def __init__(self) -> None:
"""Initialize the Config class"""
pass
# TODO change model_config there
self.debug_mode = False
self.execute_local_commands = (
os.getenv("EXECUTE_LOCAL_COMMANDS", "False") == "True"
)
# TODO change model_config there
self.plugins_dir = os.getenv("PLUGINS_DIR", 'plugins')
self.plugins:List[AutoGPTPluginTemplate] = []
def set_debug_mode(self, value: bool) -> None:
"""Set the debug mode value."""
self.debug_mode = value
def set_plugins(self,value: bool) -> None:
"""Set the plugins value."""
self.plugins = value

11
pilot/model/base.py Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import List, TypedDict
class Message(TypedDict):
"""LLM Message object containing usually like (role: content) """
role: str
content: str

3
pilot/model/chat.py Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env python3
# -*- coding:utf-8 -*-