Skip to content

Commit

Permalink
Integrate w/ LLaMA
Browse files Browse the repository at this point in the history
  • Loading branch information
rlancemartin committed Aug 23, 2023
1 parent e1dd173 commit 084762f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 5 additions & 3 deletions agent/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def generate_agent_role_prompt(agent):
"Academic Research Agent": "You are an AI academic research assistant. Your primary responsibility is to create thorough, academically rigorous, unbiased, and systematically organized reports on a given research topic, following the standards of scholarly work.",
"Business Analyst": "You are an experienced AI business analyst assistant. Your main objective is to produce comprehensive, insightful, impartial, and systematically structured business reports based on provided business data, market trends, and strategic analysis.",
"Computer Security Analyst Agent": "You are an AI specializing in computer security analysis. Your principal duty is to generate comprehensive, meticulously detailed, impartial, and systematically structured reports on computer security topics. This includes Exploits, Techniques, Threat Actors, and Advanced Persistent Threat (APT) Groups. All produced reports should adhere to the highest standards of scholarly work and provide in-depth insights into the complexities of computer security.",
"Default Agent": "You are an AI critical thinker research assistant. Your sole purpose is to write well written, critically acclaimed, objective and structured reports on given text."
# Note: for OSS model, we can use instruction tokens
"Default Agent": "[INST] <<SYS>> You are an AI critical thinker research assistant. Your sole purpose is to write well written, critically acclaimed, objective and structured reports on given text. <</SYS>>[/INST]"
}

return prompts.get(agent, "No such agent")
Expand All @@ -35,8 +36,9 @@ def generate_search_queries_prompt(question):
Returns: str: The search queries prompt for the given question
"""

return f'Write 4 google search queries to search online that form an objective opinion from the following: "{question}"'\
f'You must respond with a list of strings in the following format: ["query 1", "query 2", "query 3", "query 4"]'
# Note: for OSS model, we can use instruction tokens
return f'[INST] ### Input: Write 4 google search queries to search online that form an objective opinion from the following: "{question}"'\
f'You must respond with a list of strings in the following format: ["query 1", "query 2", "query 3", "query 4"] ### Output list:[/INST]'


def generate_resource_report_prompt(question, research_summary):
Expand Down
9 changes: 6 additions & 3 deletions config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ def __init__(self) -> None:
self.allow_downloads = False

self.selenium_web_browser = os.getenv("USE_WEB_BROWSER", "chrome")
self.llm_provider = os.getenv("LLM_PROVIDER", "ChatOpenAI")
self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo-16k")
self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "gpt-4")
#self.llm_provider = os.getenv("LLM_PROVIDER", "ChatOpenAI")
#self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo-16k")
#self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "gpt-4")
self.llm_provider = os.getenv("LLM_PROVIDER", "ChatOllama")
self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "llama2:13b-chat")
self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "llama2:13b-chat")
self.fast_token_limit = int(os.getenv("FAST_TOKEN_LIMIT", 4000))
self.smart_token_limit = int(os.getenv("SMART_TOKEN_LIMIT", 8000))
self.browse_chunk_max_length = int(os.getenv("BROWSE_CHUNK_MAX_LENGTH", 8192))
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ pydantic
fastapi
python-multipart
markdown
langchain==0.0.263
langchain==0.0.272

0 comments on commit 084762f

Please sign in to comment.