-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved error handling and added docs strings #133
Open
Azeem-2
wants to merge
19
commits into
openai:main
Choose a base branch
from
Azeem-2:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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.
Incorrect docs. Closes openai#121
Results in double logging if we dont. Closes openai#141.
…dd default model to GeminiProvider
…p and logging functions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.