Skip to content

Commit 1d58af0

Browse files
committed
fix some example request
Signed-off-by: Yaliang Wu <[email protected]>
1 parent 5aca6d7 commit 1d58af0

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

docs/tutorials/agent_framework/build_your_own_chatbot.md

+18-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ This tutorial will show you how to use `conversational` agent to build your own
1515
Note: You should replace the placeholders with prefix `your_` with your own value
1616

1717
# Steps
18+
## 0. preparation
19+
20+
Login OpenSearch Dashboard homepage, click "Add sample data", then add "Sample eCommerce orders" data.
1821

1922
## 1. Set up knowledge base
2023

@@ -102,7 +105,8 @@ POST /_plugins/_ml/connectors/_create
102105
"anthropic_version": "bedrock-2023-05-31",
103106
"max_tokens_to_sample": 8000,
104107
"temperature": 0.0001,
105-
"response_filter": "$.completion"
108+
"response_filter": "$.completion",
109+
"stop_sequences": ["\n\nHuman:","\nObservation:","\n\tObservation:","\nObservation","\n\tObservation","\n\nQuestion"]
106110
},
107111
"credential": {
108112
"access_key": "your_aws_access_key",
@@ -118,7 +122,7 @@ POST /_plugins/_ml/connectors/_create
118122
"content-type": "application/json",
119123
"x-amz-content-sha256": "required"
120124
},
121-
"request_body": "{\"prompt\":\"${parameters.prompt}\", \"max_tokens_to_sample\":${parameters.max_tokens_to_sample}, \"temperature\":${parameters.temperature}, \"anthropic_version\":\"${parameters.anthropic_version}\" }"
125+
"request_body": "{\"prompt\":\"${parameters.prompt}\", \"stop_sequences\": ${parameters.stop_sequences}, \"max_tokens_to_sample\":${parameters.max_tokens_to_sample}, \"temperature\":${parameters.temperature}, \"anthropic_version\":\"${parameters.anthropic_version}\" }"
122126
}
123127
]
124128
}
@@ -593,7 +597,9 @@ POST _plugins/_ml/connectors/_create
593597
"protocol": "http",
594598
"parameters": {
595599
"model": "gpt-3.5-turbo",
596-
"response_filter": "$.choices[0].message.content"
600+
"response_filter": "$.choices[0].message.content",
601+
"stop": ["\n\nHuman:","\nObservation:","\n\tObservation:","\nObservation","\n\tObservation","\n\nQuestion"],
602+
"system_instruction": "You are an Assistant which can answer kinds of questions."
597603
},
598604
"credential": {
599605
"openAI_key": "your_openAI_key"
@@ -686,6 +692,15 @@ POST _plugins/_ml/agents/_register
686692
"embedding_field": "stock_price_history_embedding",
687693
"doc_size": 3
688694
}
695+
},
696+
{
697+
"type": "PPLTool",
698+
"parameters": {
699+
"model_id": "your_openai_model_id",
700+
"model_type": "OPENAI",
701+
"execute": true
702+
},
703+
"include_output_in_agent_response": true
689704
}
690705
]
691706
}

0 commit comments

Comments
 (0)