Skip to content

Commit a8f4245

Browse files
yinghu5pre-commit-ci[bot]NeoZhangJianyu
authored
Update README.md for usage experience (#1135)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Neo Zhang Jianyu <jianyu.zhang@intel.com>
1 parent 096a37a commit a8f4245

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

AgentQnA/README.md

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,36 +83,47 @@ flowchart LR
8383

8484
## Deployment with docker
8585

86-
1. Build agent docker image
86+
1. Build agent docker image [Optional]
8787

88-
Note: this is optional. The docker images will be automatically pulled when running the docker compose commands. This step is only needed if pulling images failed.
88+
> [!NOTE]
89+
> the step is optional. The docker images will be automatically pulled when running the docker compose commands. This step is only needed if pulling images failed.
8990
90-
First, clone the opea GenAIComps repo.
91+
First, clone the opea GenAIComps repo.
9192

92-
```
93-
export WORKDIR=<your-work-directory>
94-
cd $WORKDIR
95-
git clone https://github.com/opea-project/GenAIComps.git
96-
```
93+
```
94+
export WORKDIR=<your-work-directory>
95+
cd $WORKDIR
96+
git clone https://github.com/opea-project/GenAIComps.git
97+
```
9798

98-
Then build the agent docker image. Both the supervisor agent and the worker agent will use the same docker image, but when we launch the two agents we will specify different strategies and register different tools.
99+
Then build the agent docker image. Both the supervisor agent and the worker agent will use the same docker image, but when we launch the two agents we will specify different strategies and register different tools.
99100

100-
```
101-
cd GenAIComps
102-
docker build -t opea/agent-langchain:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/agent/langchain/Dockerfile .
103-
```
101+
```
102+
cd GenAIComps
103+
docker build -t opea/agent-langchain:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/agent/langchain/Dockerfile .
104+
```
104105

105106
2. Set up environment for this example </br>
107+
106108
First, clone this repo.
107109

108110
```
111+
export WORKDIR=<your-work-directory>
109112
cd $WORKDIR
110113
git clone https://github.com/opea-project/GenAIExamples.git
111114
```
112115

113116
Second, set up env vars.
114117

115118
```
119+
# Example: host_ip="192.168.1.1" or export host_ip="External_Public_IP"
120+
export host_ip=$(hostname -I | awk '{print $1}')
121+
# if you are in a proxy environment, also set the proxy-related environment variables
122+
export http_proxy="Your_HTTP_Proxy"
123+
export https_proxy="Your_HTTPs_Proxy"
124+
# Example: no_proxy="localhost, 127.0.0.1, 192.168.1.1"
125+
export no_proxy="Your_No_Proxy"
126+
116127
export TOOLSET_PATH=$WORKDIR/GenAIExamples/AgentQnA/tools/
117128
# for using open-source llms
118129
export HUGGINGFACEHUB_API_TOKEN=<your-HF-token>
@@ -147,6 +158,12 @@ flowchart LR
147158
5. Launch agent services</br>
148159
We provide two options for `llm_engine` of the agents: 1. open-source LLMs, 2. OpenAI models via API calls.
149160

161+
Deploy it on Gaudi or Xeon respectively
162+
163+
::::{tab-set}
164+
:::{tab-item} Gaudi
165+
:sync: Gaudi
166+
150167
To use open-source LLMs on Gaudi2, run commands below.
151168

152169
```
@@ -155,13 +172,20 @@ flowchart LR
155172
bash launch_agent_service_tgi_gaudi.sh
156173
```
157174

175+
:::
176+
:::{tab-item} Xeon
177+
:sync: Xeon
178+
158179
To use OpenAI models, run commands below.
159180

160181
```
161182
cd $WORKDIR/GenAIExamples/AgentQnA/docker_compose/intel/cpu/xeon
162183
bash launch_agent_service_openai.sh
163184
```
164185

186+
:::
187+
::::
188+
165189
## Validate services
166190

167191
First look at logs of the agent docker containers:
@@ -181,15 +205,15 @@ You should see something like "HTTP server setup successful" if the docker conta
181205
Second, validate worker agent:
182206

183207
```
184-
curl http://${ip_address}:9095/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
208+
curl http://${host_ip}:9095/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
185209
"query": "Most recent album by Taylor Swift"
186210
}'
187211
```
188212

189213
Third, validate supervisor agent:
190214

191215
```
192-
curl http://${ip_address}:9090/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
216+
curl http://${host_ip}:9090/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
193217
"query": "Most recent album by Taylor Swift"
194218
}'
195219
```

0 commit comments

Comments
 (0)