chat-ui icon indicating copy to clipboard operation
chat-ui copied to clipboard

Add option to specify Client Name in Cohere API Client.

Open alexrs-cohere opened this issue 1 year ago • 4 comments

What

Cohere's TS API client allows to specify a client name.

It would be useful to have the ability to specify a client name by a config or env variable (ie COHERE_CLIENT_NAME) when the client is initialized.

alexrs-cohere avatar Aug 05 '24 11:08 alexrs-cohere

sounds good! care to open a PR for this?

julien-c avatar Aug 05 '24 13:08 julien-c

I was talking to @alexrs-cohere on slack about this 😄

I think the best way would be to add a clientName in our schema definition: https://github.com/huggingface/chat-ui/blob/6de97af071c69aa16e8f893adebb46f86bdeeaff/src/lib/server/endpoints/cohere/endpointCohere.ts#L11-L18 so it can be added in the MODELS env var directly

Let me know if you feel like you want to tackle it @alexrs-cohere otherwise I can do it with a quick PR

nsarrazin avatar Aug 05 '24 13:08 nsarrazin

@nsarrazin Go ahead! My TS skills are not great so probably more efficient if you submit a quick PR than reviewing my code for this 😅

alexrs-cohere avatar Aug 05 '24 14:08 alexrs-cohere

Another approach can be to add a new field in the endpoints object in MODELS such as:

[
  {
    ...
    "endpoints": [{
      "type": "cohere",
      "client_name": "abcdef",
      ...
    }]
  }
]

if this can be useful for other clients.

alexrs-cohere avatar Aug 05 '24 15:08 alexrs-cohere

Closing since this is now fixed

nsarrazin avatar Aug 25 '24 22:08 nsarrazin