Skip to content

dudududukim/OpenAI_agent_practice

Repository files navigation

!IMPORTANT

I've used this project with openai-agents-python package source code customized.

So after i'm gonna provide code with fixed source code that you should directly use code with import.

Following below openai agent SDK

OpenAI Agents SDK

⟶ A companion to OpenAI_S2S, purpose-built to implement a chained architecture.

Setup

uv sync
uv run python main.py

PLEASE READ BELOW LINE (main.py 196)

# patch_stt_event_handler()         -> un-comment this : if you are using without modifying '.venv/lib/python3.12/site-packages/agents/voice/models/openai_stt.py' _handle_events

Summuries

1. Agent definition

Agent = name / instructions / handoff_description

math_tutor_agent = Agent(
    name="Math Tutor",
    handoff_description="Specialist agent for math questions",
    instructions="You provide help with math problems. Explain your reasoning at each step and include examples",
)
  • Handoff ⊂ Tool
  • Tool: function-calling, hosted tools(retrieval/web/computer use), agents-as-tools

2. Voice Agent

OpenAI Agents SDK

alt text

Voice angent workflow SDK : SingleAgentVoiceWorkflow

PCM : Pulse Code Modulation

Results

14:15:40 [LIFECYCLE] {"event": "turn_started", "type": "voice_stream_event_lifecycle"}
14:15:43 [LIFECYCLE] {"event": "turn_ended", "type": "voice_stream_event_lifecycle"}
14:15:43 [LIFECYCLE] {"event": "session_ended", "type": "voice_stream_event_lifecycle"}

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages