-
Notifications
You must be signed in to change notification settings - Fork 150
Add console agent sample #248
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
stevkan
wants to merge
10
commits into
microsoft:main
Choose a base branch
from
stevkan:add-console-agent-sample
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.
+1,114
−0
Open
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
275e70a
Adds the console echo agent sample
stevkan df72d35
Fix console-echo-agent name in package-lock.json and ensured proper a…
stevkan c070e07
Removed to re-align with new samples folder structure
stevkan b5ce27b
Merge branch 'main' of https://github.com/microsoft/Agents into add-c…
stevkan 9d41d0e
Adds the console echo agent sample
stevkan b5cbb86
simplify console adapter
rido-min 30331bf
Merge branch 'main' of https://github.com/microsoft/Agents into add-c…
stevkan 5ca99ba
Merge remote-tracking branch 'upstream/fix/248-rido' into add-console…
stevkan 904bdcd
Refactor README and ConsoleAdapter comments for clarity and conciseness
stevkan 71da2c6
Merge branch 'main' into add-console-agent-sample
MattB-msft 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,47 @@ | ||
# Console-echo | ||
|
||
This agent has been created with Agents SDK to demonstrate how to implement a simple conversational flow from the console window. | ||
|
||
## Prerequisites | ||
|
||
- [Node.js](https://nodejs.org) version 20 or higher | ||
|
||
```bash | ||
# determine node version | ||
node --version | ||
``` | ||
|
||
## Running this sample | ||
|
||
1. Open this folder from your IDE or Terminal of preference | ||
1. Install dependencies | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
- Start the agent | ||
|
||
```bash | ||
npm start | ||
``` | ||
|
||
## Testing the agent | ||
|
||
After running `npm start`, the agent presents a prompt directly in the console window. | ||
|
||
Send messages to the agent by typing them into the console. The agent will echo your message back to you. | ||
|
||
## Adapters | ||
|
||
Adapters such as the `ConsoleAdapter` provide an abstraction for your agent to work with a variety of environments and messaging platforms. | ||
|
||
The adapter is responsible for directing incoming and outgoing communication, authentication, and so on. Adapters for different platforms and messaging technologies differ internally, but achieve the same goal - connecting agents to a stream of messages and events from users. | ||
When your agent receives an activity, the adapter wraps up everything about that activity, creates a context object, passes it to your agent's application logic, and sends responses generated by your agent back to the user's channel. | ||
|
||
In most situations, we don't work with the adapter directly, but it's good to know it's there and what it does. In this example, we're using the | ||
`ConsoleAdapter`, which provides a very simple way to exchange messages - they're sent and received via the console window. Using the ConsoleAdapter is a great way of getting started quickly with Agents. It also allows you to build and test agents that operate on your local machine without any external API calls or client applications. | ||
|
||
## Further reading | ||
|
||
To learn more about building Bots and Agents, see our [Microsoft 365 Agents SDK](https://github.com/microsoft/agents) repo. | ||
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.
Uh oh!
There was an error while loading. Please reload this page.