Hi, I've been working on SAP UI5 that is using the GPT models from SAP AI Core I believe. I wanted to integrate langsmith js into this piece of code but I'm not sure how I can do that. Can someone help me out with this. The documentation is limited to using API keys from OpenAI for now.
let parsedPrompt = '';
if (prompt) {
const { prompt: question } = prompt;
parsedPrompt = createPrompt({ ...enrichedPrompt, question });
console.log(':rocket: ~ ChatPromptService ~ sendPromptToAiCore ~ parsedPrompt:', parsedPrompt);
} else {
parsedPrompt = enrichedPrompt;
}
const destinationDetailsAI = destinationDetailsObj;
const modelConfiguration = destinationDetailsAI?.originalProperties.destinationConfiguration;
const { 'gpt-35-turbo': turbo, 'gpt-4': gpt4, 'gpt-4-32k': gpt432k } = modelConfiguration || {};
const chatModelDeploymentId = turbo || gpt4 || gpt432k;
const { 'api-version': apiVersion, 'ai-resource-group': aiResourceGroup } = modelConfiguration || {};
return response.data.choices[0].message.content;
}
return 'No proper destination configured for AI Core Chat Model Service';
} catch (error) {
console.error('Error sending prompt to AI Core Service:', error);
throw error;
}
};
return result;
};```