mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Improve samples
This commit is contained in:
@@ -2,6 +2,18 @@
|
||||
|
||||
This agent only contains an instruction (personal). It's the most basic agent with an LLM and no tools.
|
||||
|
||||
## Running the server locally
|
||||
|
||||
### Environment setup
|
||||
|
||||
Follow the instructions in the [Environment setup](../../README.md#environment-setup) section of the README in the parent directory to set up your environment and install dependencies.
|
||||
|
||||
Run the following command to start the server:
|
||||
|
||||
```bash
|
||||
python main.py
|
||||
```
|
||||
|
||||
## Interacting with the agent
|
||||
|
||||
Send a POST request to the server with a JSON body containing a "message" field to interact with the agent. For example:
|
||||
@@ -10,12 +22,6 @@ Send a POST request to the server with a JSON body containing a "message" field
|
||||
curl -X POST http://localhost:8088/responses -H "Content-Type: application/json" -d '{"input": "Hi"}'
|
||||
```
|
||||
|
||||
### Invoke with `azd`
|
||||
|
||||
```bash
|
||||
azd ai agent invoke --local "Hi"
|
||||
```
|
||||
|
||||
## Multi-turn conversation
|
||||
|
||||
To have a multi-turn conversation with the agent, include the previous response id in the request body. For example:
|
||||
@@ -23,11 +29,3 @@ To have a multi-turn conversation with the agent, include the previous response
|
||||
```bash
|
||||
curl -X POST http://localhost:8088/responses -H "Content-Type: application/json" -d '{"input": "How are you?", "previous_response_id": "REPLACE_WITH_PREVIOUS_RESPONSE_ID"}'
|
||||
```
|
||||
|
||||
Invoke with `azd`:
|
||||
|
||||
```bash
|
||||
azd ai agent invoke --local "Hi!" --conversation-id "my_conv"
|
||||
|
||||
azd ai agent invoke --local "How are you?" --conversation-id "my_conv"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user