When you publish a Cohere connection in Application Integration, the Actions and Objects appear on the Metadata tab.
Consider the following information when you use specific actions and objects:
•The Chat Command action generates a text response to a user message and streams it token by token.
The following snippet is a sample request body:
<chatInput xmlns:m="urn:informatica:ae:xquery:json2xml:meta-data"> <model>command</model> <messages> <role>system</role> <content>You respond concisely as a professional assistant respond properly</content> </messages> <messages> <role>user</role> <content>{who am i}</content> </messages> </chatInput>
•The Classify action predicts the most suitable label for the given text input by referencing the provided examples of text and label pairs.
The following snippet is a sample request body:
<root xmlns:m="urn:informatica:ae:xquery:json2xml:meta-data"> <model>embed-english-v3.0</model> <inputs m:isArray="true">Confirm your email address</inputs> <inputs m:isArray="true">hey i need u to send some $</inputs> <examples m:isArray="true"> <text>Dermatologists don't like her!</text> <label>Spam</label> </examples> <examples m:isArray="true"> <text>Hello, open to this?</text> <label>Spam</label> </examples> <examples m:isArray="true"> <text>I need help please wire me $1000 right now</text> <label>Spam</label> </examples> <examples m:isArray="true"> <text>Nice to know you ;)</text> <label>Spam</label> </examples> <examples m:isArray="true"> <text>Please help me?</text> <label>Spam</label> </examples> <examples m:isArray="true"> <text>Your parcel will be delivered today</text> <label>Not spam</label> </examples> <examples m:isArray="true"> <text>Review changes to our Terms and Conditions</text> <label>Not spam</label> </examples> <examples m:isArray="true"> <text>Weekly sync notes</text> <label>Not spam</label> </examples> <examples m:isArray="true"> <text>Re: Follow up from today's meeting</text> <label>Not spam</label> </examples> <examples m:isArray="true"> <text>Pre-read for tomorrow</text> <label>Not spam</label> </examples> </root>
•The Embeddings action lists the floating-point numbers that capture the semantic information of the represented content.
•The Rerank action takes a query and a list of texts, and then returns an ordered array where each text is assigned a relevance score.
The following snippet is a sample request body:
<root xmlns:m="urn:informatica:ae:xquery:json2xml:meta-data"> <model>rerank-v3.5</model> <query>What is the capital of the india?</query> <top_n m:type="xs:int">3</top_n> <documents m:isArray="true">Mumbai City is the capital city of the india.</documents> <documents m:isArray="true">The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.</documents> <documents m:isArray="true">DELHI is the capital of the india. It is a union territory.</documents> <documents m:isArray="true">Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.</documents> <documents m:isArray="true">Capital punishment has existed in the United States since beforethe United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states.</documents> </root>