Skip to content

Conversation

@Azeem-2
Copy link

@Azeem-2 Azeem-2 commented Mar 13, 2025

No description provided.

rm-openai and others added 19 commits March 12, 2025 17:34
…ling

Add error handling, type hints, and docstrings to various functions and methods.

* **Error Handling**
  - Add try-except blocks to handle potential exceptions in functions across multiple files.
  - Log errors and re-raise exceptions where necessary.

* **Type Hints**
  - Add type hints to function and method signatures to improve code readability and type checking.

* **Docstrings**
  - Add docstrings to functions and classes to provide descriptions and improve code documentation.

* **Specific Changes**
  - `src/agents/__init__.py`: Add error handling for setting default OpenAI key, client, and API. Add type hints and error handling for enabling verbose stdout logging.
  - `src/agents/_run_impl.py`: Add docstrings to various functions and classes. Add error handling for running input and output guardrails, invoking handoffs, and executing computer actions. Add type hints to function signatures.
  - `src/agents/agent_output.py`: Add error handling for JSON validation. Add docstrings to functions.
  - `src/agents/agent.py`: Add error handling for running agent as tool and getting system prompt. Add type hints to function signatures.
  - `src/agents/exceptions.py`: Add type hints to exception classes. Add docstrings to classes.
  - `src/agents/function_schema.py`: Add error handling for generating function schema. Add docstrings to functions.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Azeem-2/openai-agents-python?shareId=XXXX-XXXX-XXXX-XXXX).
Improve code quality by adding docstrings, type hints, and error handling
These are common issues faced by devs, so adding docs to help.
Results in double logging if we dont. Closes openai#141.
@seratch
Copy link
Member

seratch commented Jun 25, 2025

Thank you so much for putting efforts! but this PR has lots of changes. If you're still interested in contributing, please submit smaller single-purpose pull requests!

@seratch seratch closed this Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants