Skip to content

Commit

Permalink
Merge branch 'main' into phoenix-tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
rathijitpapon committed Mar 27, 2024
2 parents 2d59ed9 + 834914c commit 48fb13d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 6 additions & 1 deletion backend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,9 @@
ORCHESRATOR_ROUTER_PROMPT_PROGRAM: str = "app/dspy_integration/dspy_programs/orchestrator_router_prompt.json"

# Phoenix Configuration
PHOENIX_API_ENDPOINT: str = config("PHOENIX_API_ENDPOINT", default="http://127.0.0.1:6007/v1/traces")
PHOENIX_API_ENDPOINT: str = config("PHOENIX_API_ENDPOINT", default="http://127.0.0.1:6007/v1/traces")

#AI models
ROUTER_MODEL: str = "gpt-3.5-turbo"
SQL_GENERATION_MODEL: str = "codellama/CodeLlama-13b-Instruct-hf"
RESPONSE_SYNTHESIZER_MODEL: str = "NousResearch/Nous-Hermes-llama-2-7b"
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
EMBEDDING_MODEL_NAME,
CLINICAL_TRIAL_SQL_PROGRAM,
CLINICAL_TRIALS_RESPONSE_REFINEMENT_PROGRAM,
TOGETHER_KEY
TOGETHER_KEY,
SQL_GENERATION_MODEL,
RESPONSE_SYNTHESIZER_MODEL
)

from app.services.search_utility import setup_logger
Expand Down Expand Up @@ -62,8 +64,8 @@ class ClinicalTrialText2SQLEngine:
def __init__(self, config):
self.config = config

self.nous =dspy.Together(model = "NousResearch/Nous-Hermes-llama-2-7b", api_key=str(TOGETHER_KEY))
self.llm = dspy.Together(model = "codellama/CodeLlama-13b-Instruct-hf", api_key=str(TOGETHER_KEY))
self.nous =dspy.Together(model = str(RESPONSE_SYNTHESIZER_MODEL), api_key=str(TOGETHER_KEY))
self.llm = dspy.Together(model = str(SQL_GENERATION_MODEL), api_key=str(TOGETHER_KEY))
dspy.settings.configure(lm = self.llm)

self.sql_module = SQL_module()
Expand Down
4 changes: 2 additions & 2 deletions backend/app/router/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from app.rag.retrieval.pubmed.pubmedqueryengine import PubmedSearchQueryEngine
from app.rag.reranker.response_reranker import TextEmbeddingInferenceRerankEngine
from app.api.common.util import RouteCategory
from app.config import OPENAI_API_KEY, TOGETHER_KEY, ORCHESRATOR_ROUTER_PROMPT_PROGRAM
from app.config import OPENAI_API_KEY, TOGETHER_KEY, ORCHESRATOR_ROUTER_PROMPT_PROGRAM, ROUTER_MODEL
from app.services.search_utility import setup_logger

import dspy
Expand All @@ -34,7 +34,7 @@ def __init__(self, config):



self.llm = dspy.OpenAI(model="gpt-3.5-turbo", api_key=str(OPENAI_API_KEY))
self.llm = dspy.OpenAI(model=str(ROUTER_MODEL), api_key=str(OPENAI_API_KEY))
dspy.settings.configure(lm = self.llm)
self.router = Router_module()
self.router.load(ORCHESRATOR_ROUTER_PROMPT_PROGRAM)
Expand Down

0 comments on commit 48fb13d

Please sign in to comment.