
Product
Introducing GitHub Actions Scanning Support
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
@squiz/dxp-ai-conversation-client
Advanced tools
Exposes the DXP AI Conversation Client service as a package for consumers
The @squiz/dxp-ai-conversation-client
is an auto-generated SDK designed to simplify integration with the DXP AI Service for handling chat interactions and conversation rating.
Install the SDK package using your preferred package manager:
npm install @squiz/dxp-ai-conversation-client
Create an instance of the SDK client by providing the necessary configuration such as the base URL and authentication/session information.
import { DxpAiConversationClient } from '@squiz/dxp-ai-conversation-client';
const client = new DxpAiConversationClient();
Use the processChatMessage
method to start or continue a conversation by sending chat messages.
const aiId = 'your-ai-id';
client.processChatMessage(aiId, {
message: 'Hello, how can I get help?'
})
.then(response => {
console.log('Chat response:', response);
})
.catch(error => {
console.error('Error processing chat message:', error);
});
Use the rateConversation
method to submit user feedback on whether a conversation was helpful.
const aiId = 'your-ai-id';
const threadId = 'conversation-thread-id';
client.rateConversation(aiId, threadId, {
rating: 'positive', # positive | negative
})
.then(response => {
console.log('Rating submitted:', response);
})
.catch(error => {
console.error('Error submitting rating:', error);
});
processChatMessage(aiId: string, payload: ProcessChatMessagePayload): Promise<ProcessChatMessageResponse>
Handles processing or starting a new conversation and sending messages in ongoing conversations. Requires an active DXP Session.
rateConversation(aiId: string, threadId?: string, payload: RateConversationPayload): Promise<RateConversationResponse>
Allows users to rate if a conversation was helpful.
If you need to extend or modify the SDK, please refer to the Contribution Guidelines in the DXP AI service repository.
The SDK source code and OpenAPI specification are located in the DXP AI service repository at:
packages/dxp-ai-conversation-client
This SDK uses Changesets for versioning and release management, integrated into the release pipeline to publish both CommonJS (CJS) and ECMAScript Module (ESM) variants to NPM.
FAQs
Exposes the DXP AI Conversation Client service as a package for consumers
We found that @squiz/dxp-ai-conversation-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 71 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.