Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enables the use of custom handlers and prompts in functions while modernizing type annotations and agent interactions across several examples. Key changes include:
- Adding type annotations and inline type ignores where needed (e.g. in record_audio).
- Introducing a new custom handler (ShowPromptHandler) and updating agent tool configurations.
- Replacing legacy agent tool examples with updated asynchronous implementations and prompt string adjustments.
Reviewed Changes
Copilot reviewed 23 out of 33 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| examples/talk_to_marvin.py | Added type annotations to record_audio and updated the pyaudio import comment. |
| examples/slackbot/search.py | Added explicit type annotation for the results variable. |
| examples/provider_specific/openai/run_agent.py | Updated the agent initialization with provider-based API configuration. |
| examples/hello_task.py | Updated the task instantiation with a generic type parameter. |
| examples/hello_fn.py | Updated the function decorator to include a prompt argument. |
| examples/hello_agent.py | Refactored the file functions and adjusted the agent’s prompt string. |
| examples/deepseek_chat.py | Switched to asynchronous agent execution using run_async. |
| examples/custom_handler.py | Added a custom handler that prints the initial user prompt. |
| examples/agent_uses_tools.py | Removed redundant agent tool usage in favor of updated implementations. |
Files not reviewed (10)
- .cursor/rules/python-style.mdc: Language not supported
- docs/api-reference/marvin-agents-agent.mdx: Language not supported
- docs/api-reference/marvin-fns-cast.mdx: Language not supported
- docs/api-reference/marvin-fns-classify.mdx: Language not supported
- docs/api-reference/marvin-fns-extract.mdx: Language not supported
- docs/api-reference/marvin-fns-fn.mdx: Language not supported
- docs/api-reference/marvin-fns-generate.mdx: Language not supported
- docs/api-reference/marvin-fns-say.mdx: Language not supported
- docs/api-reference/marvin-fns-summarize.mdx: Language not supported
- docs/api-reference/marvin-handlers-queue_handler.mdx: Language not supported
This file contains hidden or 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
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.
closes #1124 (see this example)
also see new examples