-
Notifications
You must be signed in to change notification settings - Fork 138
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
Add Cohere Chat blueprint with RAG #1991
Add Cohere Chat blueprint with RAG #1991
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1991 +/- ##
============================================
- Coverage 82.94% 82.92% -0.02%
+ Complexity 5414 5412 -2
============================================
Files 521 521
Lines 21713 21713
Branches 2215 2215
============================================
- Hits 18009 18005 -4
- Misses 2808 2811 +3
- Partials 896 897 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@ylwu-amzn also updated this new doc with some of the suggestions from the Embed one. Take a look when you get a chance, many thanks. |
|
||
This blueprint will show you how to connect a Cohere chat model to your Opensearch cluster. You will require a Cohere API key to create a connector. | ||
|
||
It is suggested to use the default `command` model for using Chat. Cohere's Chat endpoint also features Retrievel Augmented Generation (or RAG) parameters, by adding `connectors` or `documents` in your request body, in addition to allowing you to pass a `conversation_id` to provide context to Cohere's model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by adding
connectors
ordocuments
in your request body
I think you mean Cohere connectors here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes correct, Cohere connectors - there should be text earlier linking docs and explaining the difference, but I can clarify that here as well
POST /_plugins/_ml/models/<MODEL_ID_HERE>/_predict | ||
{ | ||
"parameters": { | ||
"message": "What is the weather like in London?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure the example in this doc can work
"message": "What is the weather like in London?", | |
"message": "What is the weather like in London?" |
"Authorization": "Bearer ${credential.cohere_key}", | ||
"Request-Source": "unspecified:opensearch" | ||
}, | ||
"request_body": "{ \"message\": ${parameters.message}, \"model\": \"${parameters.model}\" }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"request_body": "{ \"message\": ${parameters.message}, \"model\": \"${parameters.model}\" }" | |
"request_body": "{ \"message\": \"${parameters.message}\", \"model\": \"${parameters.model}\" }" |
@tianjing-li You can refer to this tutorial for how to use Cohere command model in RAG pipeline #2075 |
@ylwu-amzn thank you! |
* Add Chat blueprint with RAG * Remove content-type * Updates * Update docs (cherry picked from commit 38566f5)
* Add Chat blueprint with RAG * Remove content-type * Updates * Update docs (cherry picked from commit 38566f5) Co-authored-by: Tianjing Li <[email protected]>
* Add Chat blueprint with RAG * Remove content-type * Updates * Update docs
Description
[Describe what this change achieves]
Issues Resolved
[List any issues this PR will resolve]
N/A
Check List
No new functionality, just new docs
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.