Update OpenAI model references to gpt-5.2 and gpt-5-mini

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
michael 2026-02-23 08:42:55 -06:00
parent 594f749d4c
commit bfe37f5be8
3 changed files with 8 additions and 8 deletions

View file

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

View file

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

View file

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