Closed huytool157 closed 4 months ago
@huytool157 you should be able to pass the baseUrl in the environment
key
new Cohere({
environment: "YOUR_BASE_URL"
});
@dsinghvi thanks, any way to do headers
?
Hey @huytool157 sorry for delay on this. One way you could do this is to pass a custom fetcher to the constructor.
import { CohereClient } from "cohere-ai";
import { Fetcher, fetcher } from "cohere-ai/core";
const cohere = new CohereClient({
token: '...',
fetcher: (args: Fetcher.Args) => fetcher({ ...args, headers: { ...args.headers, myHeader: "hello!" } })
});
Let me know if that solves your problem. We will track a better fix for this though
@billytrend-cohere Is this fetcher
option new? What's the minimum version that I need to upgrade to? Currently in 7.9.5
.
yeah should be in 7.10.2
and up but would recommend latest version if possible! Should be a smooth update but let me know if you need assistance
@billytrend-cohere did you guys add some @aws-sdk
deps recently? I'm getting some peer dependency issues trying to upgrade.
backend
└─┬ @aws-sdk/client-sso-oidc 3.609.0
├── ✕ unmet peer @aws-sdk/client-sts@^3.609.0: found 3.347.1
└─┬ @aws-sdk/credential-provider-node 3.609.0
└─┬ @aws-sdk/credential-provider-ini 3.609.0
├── ✕ unmet peer @aws-sdk/client-sts@^3.609.0: found 3.347.1
└─┬ @aws-sdk/credential-provider-web-identity 3.609.0
└── ✕ unmet peer @aws-sdk/client-sts@^3.609.0: found 3.347.1
we did, will look into this issue asap
Thanks, preferably we should not have to deal with this because we are using @aws-sdk/client-sts
in different parts of the codebase and we only use the native cohere integrations without AWS Bedrock
We suspect it might be related to https://github.com/aws/aws-sdk-js-v3/issues/6258 but will keep you posted, meantime 7.10.2
shouldn't contain the problematic dependency!
I actually think it starts from 7.10.2
. These dependencies have @aws-sdk/client-sts
under the hood. Kinda unfortunate that it's the same version as the fetcher
option and now I'm stucked.
@billytrend-cohere following up on this!
I ended up upgrading @aws-sdk/client-sts
to 3.616.0
. Not ideal since you shouldn't have to upgrade other packages to get cohere-ai
working but we passed that hoop, going to close the issue.
Is there a way to do this in Cohere?