SAP / ai-sdk-js

SAP Cloud SDK for AI is the official Software Development Kit (SDK) for SAP AI Core, SAP Generative AI Hub, and Orchestration Service.
Apache License 2.0
36 stars 4 forks source link

Question about using ai-sdk-js library to run models locally #309

Closed LiuXiaoKai03 closed 1 day ago

LiuXiaoKai03 commented 2 days ago

Describe the Question

Hi all,

I've recently been experimenting with the ai-sdk-js library, and I've run into some issues when trying to use the foundation models locally, mainly regarding the AICORE_SERVICE_KEY value. I have created an instance of the ai core service in BTP with the gpt model deployed and downloaded the service key. I guess the .env file has the following format,

AICORE_SERVICE_KEY="{ 'clientid': 'xxx', 'clientsecret': 'xxx', 'url': 'xxx', 'identityzone': 'xxx', 'identityzoneid': 'xxx', 'appname': 'xxx', 'serviceurls': { 'AI_API_URL': 'xxxx' } }"

But the error log shows 'Error in chatCompletion: Error: Failed to fetch the list of deployments: ErrorWithCause: Could not fetch client credentials token for service of type "aicore"'.

I was wondering if you could provide some guidance on how to solve the problem above.

Thank you very much.

ZhongpinWang commented 2 days ago

Hi @LiuXiaoKai03 ,

Thanks for opening the issue. Could you please try switching ' and "? So the outside quote should be single quote and within JSON, it should be double quote.

ZhongpinWang commented 1 day ago

@LiuXiaoKai03 I will close this issue as switching quotes should solve the problem. If the problem still persists, feel free to reopen it.