11 Commits

Author SHA1 Message Date
Kazuhiro Sera a6ce52d255 docs: use decorators module throughout examples (#3946) 2026-07-28 07:57:19 +09:00
Kazuhiro Sera 921135630b fix: #3512 type tool-end hook results as object (#3518) 2026-05-28 17:57:33 +09:00
Kazuhiro Sera 9b1f6eddc8 docs: improve examples for auto runs 2026-03-06 17:59:35 +09:00
Kazuhiro Sera c06a8bb42a feat: add examples auto-run skill and refresh example scripts (#2303)
see also: https://github.com/openai/openai-agents-js/pull/848
2026-01-13 22:59:15 +09:00
Wen-Tien Chang 659f706d56 Add AgentHookContext with turn_input for agent hooks (#2213) 2025-12-22 09:51:37 +09:00
Wen-Tien Chang d659a738da docs: clarify on_tool_start and on_tool_end hooks for local tools only (#2037) 2025-11-04 12:16:42 +09:00
Abbas Asad 65cb91ce26 Add input validation and type conversion for user input (#1462)
## Summary

Fixed a type safety issue where user input was being used as a string
without conversion to integer, which could cause runtime errors and type
mismatches.

## Problem

The code was using `input()` which returns a string, but then using it
directly in the f-string without converting it to an integer. This could
cause:
- Type mismatches when the string is passed to functions expecting
integers
- Runtime errors when users enter non-numeric input
- Inconsistent behavior with the function signature expectations

## Changes Made

Added proper input validation and type conversion:
- Wrapped the input processing in a try-except block
- Convert user input to integer using `int(user_input)`
- Added error handling for invalid input with user-friendly message
- Used the converted integer value in the f-string instead of raw string
input

This ensures type safety and provides better user experience with proper
error handling.
2025-08-14 12:33:22 +09:00
Abbas Asad e4699c358b Fix: Clarify random_number function docstring for inclusive range (#1461) 2025-08-14 12:32:24 +09:00
Daniel Hashmi f09874c6be Fix agent lifecycle example output to reflect correct hook execution order (#1015)
**Problem:**
The expected output in the agent lifecycle example incorrectly shows
agent start hooks (`on_start`) running after tool execution and multiple
times for the same agent. This misleads developers about when these
lifecycle events actually occur.

**Solution:**
Updated the expected output to accurately reflect the OpenAI Agents
framework behavior:
- Agent start hooks run immediately when an agent begins execution
- Start hooks only run once per agent activation, controlled by the
`should_run_agent_start_hooks` flag
- After handoffs, the new agent's start hook runs as the first event
2025-07-08 11:14:16 -04:00
CCM 8540b1e65b fix typo in agent_lifecycle_example.py 2025-03-14 19:14:26 +08:00
Rohan Mehta aaec57a426 Initial commit 2025-03-11 09:42:28 -07:00