Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

Cohere Connector Guide

Cohere Connector Guide

Cohere connection actions and objects

Cohere connection actions and objects

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 following snippet is a sample request body:
    <root xmlns:m="urn:informatica:ae:xquery:json2xml:meta-data"> <model>embed-v4.0</model> <texts>goodbye</texts> <texts>goodbye now</texts> <input_type>classification</input_type> <embedding_types m:isArray="true">float</embedding_types> </root>
  • The
    Get Connector Details
    action retrieves the connector details using its ID.
    The following snippet is a sample response:
    <root> <connector> <updated_at>0001-01-01T00:00:00Z</updated_at> <name>Web Search</name> <created_at>0001-01-01T00:00:00Z</created_at> <continue_on_failure>true</continue_on_failure> <id>web-search</id> </connector> </root>
  • The
    Get Model
    action returns detailed information about a model based on its name.
    The following snippet is a sample response:
    <root> <features>logprobs</features> <features>json_mode</features> <features>json_schema</features> <features>strict_tools</features> <features>tools</features> <endpoints>generate</endpoints> <endpoints>chat</endpoints> <endpoints>summarize</endpoints> <finetuned>false</finetuned> <name>command-r</name> <context_length>132096</context_length> <tokenizer_url>https://storage.googleapis.com/cohere-public/tokenizers/command-r.json</tokenizer_url> <supports_vision>false</supports_vision> <default_endpoints/> </root>
  • The
    Get Model List
    action returns a list of available models, including Cohere models and user-created models.
    The following snippet is a sample response:
    <root> <models> <features/> <endpoints>embed</endpoints> <endpoints>classify</endpoints> <finetuned>false</finetuned> <name>embed-english-light-v3.0</name> <context_length>512</context_length> <tokenizer_url>https://storage.googleapis.com/cohere-public/tokenizers/embed-english-light-v3.0.json</tokenizer_url> <supports_vision>false</supports_vision> <default_endpoints/> </models> <models> <features/> <endpoints>embed</endpoints> <endpoints>classify</endpoints> <finetuned>false</finetuned> <name>embed-multilingual-v2.0</name> <context_length>256</context_length> <tokenizer_url>https://storage.googleapis.com/cohere-public/tokenizers/embed-multilingual-v2.0.json</tokenizer_url> <supports_vision>false</supports_vision> <default_endpoints/> </models> </root>
  • The
    List Connectors
    action returns a list of connectors ordered by their descending creation date.
    The following snippet is a sample response:
    <root> <connectors> <updated_at>0001-01-01T00:00:00Z</updated_at> <name>Web Search</name> <created_at>0001-01-01T00:00:00Z</created_at> <active>true</active> <continue_on_failure>true</continue_on_failure> <id>web-search</id> </connectors> <connectors> <auth_type>oauth</auth_type> <updated_at>2024-09-16T03:23:25.902505Z</updated_at> <organization_id>d489c39a-e152-49da-9ddc-9801bd74d823</organization_id> <name>Google Drive (beta)</name> <created_at>2024-09-04T20:03:20.420686Z</created_at> <active>true</active> <continue_on_failure>false</continue_on_failure> <id>gdrive-with-oauth-18fbc3</id> <oauth> <authorize_url>https://accounts.google.com/o/oauth2/auth</authorize_url> <scope>https://www.googleapis.com/auth/drive.readonly</scope> <token_url>https://oauth2.googleapis.com/token</token_url> </oauth> <url>https://gdrive-o5btz7ucgq-uc.a.run.app/search</url> </connectors> <total_count>2</total_count> </root>
  • 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>
    The following snippet is a sample response:
    <root> <meta> <billed_units> <search_units>1</search_units> </billed_units> <api_version> <version>2</version> </api_version> </meta> <id>737d16b8-9665-420e-b30b-d10c77f63ab2</id> <results> <index>2</index> <relevance_score>0.852752</relevance_score> </results> <results> <index>0</index> <relevance_score>0.84183896</relevance_score> </results> <results> <index>1</index> <relevance_score>0.08085701</relevance_score> </results> </root>
For more information about the specific action in the Cohere connection, see the Cohere documentation.

0 COMMENTS

We’d like to hear from you!