diff --git a/examples/basic/stream_function_call_args.py b/examples/basic/stream_function_call_args.py index 3c3538772..e04806169 100644 --- a/examples/basic/stream_function_call_args.py +++ b/examples/basic/stream_function_call_args.py @@ -1,5 +1,5 @@ import asyncio -from typing import Any +from typing import Annotated, Any, Optional from openai.types.responses import ResponseFunctionCallArgumentsDeltaEvent @@ -7,14 +7,18 @@ @function_tool -def write_file(filename: str, content: str) -> str: +def write_file(filename: Annotated[str, "Name of the file"], content: str) -> str: """Write content to a file.""" return f"File {filename} written successfully" @function_tool -def create_config(project_name: str, version: str, dependencies: list[str]) -> str: - """Create a configuration file for a project.""" +def create_config( + project_name: Annotated[str, "Project name"], + version: Annotated[str, "Project version"], + dependencies: Annotated[Optional[list[str]], "Dependencies (list of packages)"], +) -> str: + """Generate a project configuration file.""" return f"Config for {project_name} v{version} created"