-
Notifications
You must be signed in to change notification settings - Fork 0
create a sample agent #3
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
Open
Fr4nc3
wants to merge
14
commits into
main
Choose a base branch
from
feat/new_agent
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.
Open
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1a2b7e1
create a sample agent
Fr4nc3 bf708cf
Pulled references, add swagger, add app flow
marktayl1 a4643a2
Remove references to legal agent, Fix TOC links
marktayl1 3bf5016
fix: UI Enhancements, Error handling, Docker integration and other bu…
Roopan-Microsoft ab9ff48
fix: error handled and removed console logs from the front-end code (…
Roopan-Microsoft 4b9a833
Merge remote-tracking branch 'upstream/main' into feat/new_agent
Fr4nc3 65d7249
Update utils.py
Fr4nc3 8f5bc03
fix: Replace the track_event function with track_event_if_configured …
Roopan-Microsoft 217ff8a
docs: update docs for correct naming and place holders (#57)
Roopan-Microsoft b1808ec
Merge remote-tracking branch 'upstream/main' into feat/new_agent
Fr4nc3 4d17c26
Merge remote-tracking branch 'upstream/main'
Fr4nc3 65850d0
Merge branch 'main' into feat/new_agent
Fr4nc3 f6ee968
Added Francia's steps
marktayl1 3cbccbf
clean up ToC
marktayl1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| from autogen_core.base import AgentId | ||
| from autogen_core.components.models import AzureOpenAIChatCompletionClient | ||
| from autogen_core.components.tools import Tool | ||
| from autogen_core.components.tool_agent import ToolAgent | ||
| from agents.base_agent import BaseAgent | ||
| from typing import List | ||
| from context.cosmos_memory import CosmosBufferedChatCompletionContext | ||
|
|
||
| # Define Baker tools (functions) | ||
| async def bake_cookies(cookie_type: str, quantity: int) -> str: | ||
| return f"Baked {quantity} {cookie_type} cookies." | ||
|
|
||
| async def prepare_dough(dough_type: str) -> str: | ||
| return f"Prepared {dough_type} dough." | ||
|
|
||
| # Function to return Baker tools | ||
| def get_baker_tools() -> List[Tool]: | ||
| from autogen_core.components.tools import FunctionTool | ||
|
|
||
| return [ | ||
| FunctionTool( | ||
| bake_cookies, | ||
| description="Bake cookies of a specific type.", | ||
| name="bake_cookies", | ||
| ), | ||
| FunctionTool( | ||
| prepare_dough, | ||
| description="Prepare dough of a specific type.", | ||
| name="prepare_dough", | ||
| ), | ||
| ] | ||
|
|
||
| # Define the BakerAgent class | ||
| class BakerAgent(BaseAgent): | ||
| def __init__( | ||
| self, | ||
| model_client: AzureOpenAIChatCompletionClient, | ||
| session_id: str, | ||
| user_id: str, | ||
| memory: CosmosBufferedChatCompletionContext, | ||
| tools: List[Tool], | ||
| agent_id: AgentId, | ||
| ): | ||
| super().__init__( | ||
| "BakerAgent", | ||
| model_client, | ||
| session_id, | ||
| user_id, | ||
| memory, | ||
| tools, | ||
| agent_id, | ||
| system_message="You are an AI Agent specialized in baking tasks. You can bake cookies and prepare dough based on user requests.", | ||
| ) |
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The agentIcon for BakerAgent is incorrectly set to 'manager'. It should be set to an icon related to baking.