Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions examples/opentelemetry/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def _get_openai_client():


@trace()
def _query_openai(prompt: str, model: str = "gpt-4", chat_history: Optional[list] = None):
def _query_openai(prompt: str, model: str = "gpt-4o-mini", chat_history: Optional[list] = None):

chat_history = chat_history or []
client = _get_openai_client()
result = client.chat.completions.create(
Expand All @@ -80,7 +81,7 @@ def decide_mode(state: State, __tracer: TracerFactory) -> Tuple[dict, State]:
"the mode would be 'generate_image'. If the prompt is 'what is the capital of France', the mode would be 'answer_question'."
"If none of these modes apply, please respond with 'unknown'."
)
content = _query_openai(prompt, model="gpt-4o")
content = _query_openai(prompt, model="gpt-4o-mini")
mode = content.lower()
if mode not in MODES:
mode = "unknown"
Expand All @@ -104,7 +105,7 @@ def prompt_for_more(state: State) -> Tuple[dict, State]:
def chat_response(
state: State,
prepend_prompt: str,
model: str = "gpt-4o",
model: str = "gpt-4o-mini",
) -> State:
chat_history = state["chat_history"].copy()
chat_history_to_send = chat_history[:-1]
Expand Down
Loading