You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: supporting-blog-content/agent-builder-a2a-agent-framework/README.md
+25-31Lines changed: 25 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ This is an example Python console app that demonstrates how to connect and utili
8
8
9
9
1. An Elasticsearch deployment running in [Elastic Cloud](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-example-apps).
10
10
* Requires Elasticsearch Serverless (or for hosted deployments at least Elasticsearch version 9.2.0).
11
-
2.An integrated development environment (IDE) like [Visual Studio Code](https://code.visualstudio.com/download) running on your local computer.
11
+
2.A text editor or an integrated development environment (IDE) like [Visual Studio Code](https://code.visualstudio.com/download) running on your local computer.
12
12
3.[Python version 3.10 or greater](https://www.python.org/downloads/) installed on your local computer.
13
13
14
14
## Setup your Elasticsearch deployment
@@ -72,41 +72,44 @@ This is an example Python console app that demonstrates how to connect and utili
72
72
73
73
74
74
75
-
## Running the example app
75
+
## Clone the example app
76
76
77
-
1. Open Visual Studio Code and open a new terminal within the Visual Studio Code editor.
78
-
2. In the open terminal, clone the Search Labs source code repository which contains the Elastic Agent Builder A2A App example.
77
+
1. Open a terminal and clone the Search Labs source code repository which contains the Elastic Agent Builder A2A App example. Run the following command to clone the example app:
3.`cd` to change directory to the example code located in the `example-apps/agent-builder-a2a-agent-framework` subdirectory.
81
+
3.`cd` to change directory to the example code located in the `supporting-blog-content/agent-builder-a2a-agent-framework` subdirectory.
83
82
84
-
cd elasticsearch-labs/example-apps/agent-builder-a2a-agent-framework
83
+
cd elasticsearch-labs/supporting-blog-content/agent-builder-a2a-agent-framework
85
84
86
-
4. Replace placeholder values in `elastic_agent_builder_a2a.py` with values copied from your Elastic deployment.
87
-
1. Open the file `elastic_agent_builder_a2a.py` in the Visual Studio editor.
88
-
2. Replace <YOUR-ELASTIC-AGENT-BUILDER-URL\>
85
+
## Setup up the environment variables
86
+
87
+
1. Setup the environment variables with values copied from your Elastic deployment.
88
+
1. Make a copy of the file `env.example` and name the new file `.env `
89
+
2. Edit the `.env` file to set the values of the environment variables to use the values copied from your Elastic deployment.
90
+
* Replace <YOUR-ELASTIC-AGENT-BUILDER-URL\>
89
91
1. In your Elastic deployment, go to the Elastic Agent Builder - Tools page. Click the **MCP Server** dropdown at the top of the Tools page. Select **Copy MCP Server URL.**
90
-
2.In Visual Studio add the **MCP Server URL** value to the `elastic-agent-builder-a2a.py` file.
92
+
2.Add the **MCP Server URL** value to the `.env` file.
91
93
* Find where the placeholder text “**<YOUR-ELASTIC-AGENT-BUILDER-URL\>**” appears and paste in the copied **MCP Server URL** to replace the placeholder text. Now edit the pasted **MCP Server URL**. Delete the text “mcp” at the end of the URL and replace it with the text “a2a”. The edited URL should look something like this
1. In your Elastic deployment, click **Elasticsearch** in the navigation menu to go to your deployment’s home page.
97
99
2. Click **Create API key** to create a new API key.
98
100
3. After the API key is created, copy the API Key value.
99
-
4.In Visual Studio add the API Key value to the `elastic-agent-builder-a2a.py` file.
101
+
4.Add the API Key value to the `.env` file.
100
102
* Find where the placeholder text “**<YOUR-ELASTIC-API-KEY\>**” appears and paste in the copied API Key value to replace the placeholder text.
103
+
104
+
3. Save the changes to the `.env` file.
101
105
102
-
4. Confirm the **relative_card_path** is set correctly in the `elastic-agent-builder-a2a.py` file by finding the code line that starts with the text “agent_card”. Confirm that the **relative_card_path** matches the Agent ID you specified when you created the agent in Elastic Agent Builder. If your Agent ID is “helloworld_agent” then the **relative_card_path** should be set to `/helloworld_agent.json`
103
-
5. Save the `elastic_agent_builder_a2a.py` file in the Visual Studio editor.
106
+
## Running the example app with Python
104
107
105
-
5. Create a Python virtual environment by running the following code in the Visual Studio Code terminal.
108
+
1. Create a Python virtual environment by running the following code in the terminal.
106
109
107
110
python -m venv .venv
108
111
109
-
6. Activate the Python virtual environment.
112
+
2. Activate the Python virtual environment.
110
113
* If you’re running MacOS, the command to activate the virtual environment is:
111
114
112
115
source .venv/bin/activate
@@ -115,25 +118,16 @@ This is an example Python console app that demonstrates how to connect and utili
115
118
116
119
.venv\Scripts\activate
117
120
118
-
7. Install the Microsoft Agent Framework with the following `pip` command:
121
+
3. Install the Microsoft Agent Framework along with its necessary Python packages by running the following `pip` command:
119
122
120
-
pip install agent-framework
123
+
pip install -r requirements.txt
121
124
122
-
8. Run the example code by entering the following command into the terminal:
125
+
4. Run the example app by entering the following command into the terminal:
123
126
124
127
python elastic_agent_builder_a2a.py
125
128
126
-
## Running the example test
127
-
128
-
1. Setup the environment variables.
129
-
1. Make a copy of the file `env.example` and name the new file `.env `
130
-
2. Edit the `.env` file to set the values of the environment variables to use the values copied from your Elastic deployment. See instructions on where to get these values in the [Running the example app](#running-the-example-app) section of this `README.md` file.
131
-
* Set the value of **ES_AGENT_URL** to be the value of **YOUR-ELASTIC-AGENT-BUILDER-URL**
132
-
* Set the value of **ES_API_KEY** to be value of **YOUR-ELASTIC-API-KEY**
133
-
2. Run the test directly with Python.
134
-
135
-
python test_elastic_agent_builder_a2a.py
129
+
## Running the example app with Docker
136
130
137
-
3. Run the test with Docker.
131
+
1. Run the example app with Docker by entering the following command into the terminal:
0 commit comments