Skip to content

Commit 34eb6bd

Browse files
committed
Update OpenAI model in opentelemetry example
1 parent 45c0538 commit 34eb6bd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/opentelemetry/application.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def _get_openai_client():
5656

5757

5858
@trace()
59-
def _query_openai(prompt: str, model: str = "gpt-4", chat_history: Optional[list] = None):
59+
def _query_openai(prompt: str, model: str = "gpt-4o-mini", chat_history: Optional[list] = None):
60+
6061
chat_history = chat_history or []
6162
client = _get_openai_client()
6263
result = client.chat.completions.create(
@@ -80,7 +81,7 @@ def decide_mode(state: State, __tracer: TracerFactory) -> Tuple[dict, State]:
8081
"the mode would be 'generate_image'. If the prompt is 'what is the capital of France', the mode would be 'answer_question'."
8182
"If none of these modes apply, please respond with 'unknown'."
8283
)
83-
content = _query_openai(prompt, model="gpt-4o")
84+
content = _query_openai(prompt, model="gpt-4o-mini")
8485
mode = content.lower()
8586
if mode not in MODES:
8687
mode = "unknown"
@@ -104,7 +105,7 @@ def prompt_for_more(state: State) -> Tuple[dict, State]:
104105
def chat_response(
105106
state: State,
106107
prepend_prompt: str,
107-
model: str = "gpt-4o",
108+
model: str = "gpt-4o-mini",
108109
) -> State:
109110
chat_history = state["chat_history"].copy()
110111
chat_history_to_send = chat_history[:-1]

0 commit comments

Comments
 (0)