SAP / ai-sdk-js

Integrate chat completion into your business applications with SAP Cloud SDK for AI. Leverage the Generative AI Hub of SAP AI Core to make use of templating, grounding, data masking, content filtering and more. Access all features of SAP AI Core with the SAP Cloud SDK for AI.
Apache License 2.0
15 stars 0 forks source link

Langchain client does not include Resource Group Header #183

Open pj-sap opened 1 day ago

pj-sap commented 1 day ago

Describe the Bug

When working with the langchain client, the set Resource Group is ignored in requests to the chat/completions endpoint. Retrieval of the deployment works properly though (as can be seen from the used endpoint).

Minimal code example:

const chatClient = new AzureOpenAiChatClient({ modelName: 'gpt-4o', resourceGroup: 'my-resource-group' });
let resp = await chatClient.invoke('Hey, how are you?');

Steps to Reproduce

  1. Create a new resource group in AI Core (!= 'default')
  2. Create a deployment for the resource group
  3. Try to call the deployment through the langchain client
  4. Inspect the request made to AI Core, the Resource Group Header is set to 'default'; therefore, the request returns with a 404 error

Expected Behavior

The Resource Group is properly set in the chat/completions call.

Screenshots

No response

Used Versions

Code Examples

No response

Log File

No response

Affected Development Phase

Getting Started

Impact

Inconvenience

Timeline

No response

Additional Context

No response

tomfrenken commented 1 day ago

Hi @pj-sap,

thanks for raising the issue, I've created a PR and we should be able to include the fix in our next release on Thursday.