diff --git a/config.py b/config.py index df7a987..4ef22f9 100644 --- a/config.py +++ b/config.py @@ -61,7 +61,7 @@ os.environ["LLAMA_CLOUD_API_KEY"] = LLAMA_CLOUD_API_KEY print(f"OpenAI API key {'is set' if OPENAI_API_KEY else 'is NOT set'}", file=sys.stderr) # --- AI Model Configuration --- -LLM_MODEL = "chatgpt-4o-latest" # Or "gpt-4o" etc. +LLM_MODEL = "gpt-5.2" # Or "gpt-4o" etc. EMBEDDING_MODEL = "text-embedding-3-small" LLM_TEMPERATURE = 0.3 LLM_TIMEOUT = 300.0 # 5 minutes diff --git a/graph_rag_integration.py b/graph_rag_integration.py index a0dd2e0..6204899 100644 --- a/graph_rag_integration.py +++ b/graph_rag_integration.py @@ -219,7 +219,7 @@ class GraphRAGStore: for i, chunk in enumerate(chunks): try: # Use GPT-4o-mini model for better cost efficiency - llm = OpenAI(model="gpt-4o-mini") + llm = OpenAI(model="gpt-5-mini") messages = [ ChatMessage( role="system", @@ -237,7 +237,7 @@ class GraphRAGStore: if summaries: final_summary_text = "\n\n".join(summaries) try: - llm = OpenAI(model="gpt-4o-mini") + llm = OpenAI(model="gpt-5-mini") messages = [ ChatMessage( role="system", @@ -257,7 +257,7 @@ class GraphRAGStore: # For normal size text, use the larger model directly try: # Use GPT-4o-mini model for better cost efficiency - llm = OpenAI(model="gpt-4o-mini") + llm = OpenAI(model="gpt-5-mini") messages = [ ChatMessage( role="system", @@ -825,9 +825,9 @@ def generate_final_answer(query, retrieval_result, llm): # If no model was provided or we're forcing to use a specific model if llm is None or not hasattr(llm, 'chat'): - # Fallback to gpt-4o-mini for better cost efficiency - llm = OpenAI(model="gpt-4o-mini") - log_structured('info', 'Using gpt-4o-mini model for final answer generation') + # Fallback to gpt-5-mini for better cost efficiency + llm = OpenAI(model="gpt-5-mini") + log_structured('info', 'Using gpt-5-mini model for final answer generation') prompt = f""" Based on the following information from two different sources, please answer this question: {query} diff --git a/mongodb_utils.py b/mongodb_utils.py index 75086be..e138ab5 100644 --- a/mongodb_utils.py +++ b/mongodb_utils.py @@ -327,7 +327,7 @@ def generate_conversation_title(conversation_id: str, content: List[Dict]) -> Op # Create LLM instance llm = LlamaOpenAI( - model="chatgpt-4o-latest", + model="gpt-5.2", temperature=0.3, )