🚀 DAY 4 OF LAUNCH WEEK: Introducing GitHub Actions Scanning Support.Learn more →
Socket
Book a DemoInstallSign in
Socket

@squiz/dxp-ai-conversation-client

Package Overview
Dependencies
Maintainers
71
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@squiz/dxp-ai-conversation-client

Exposes the DXP AI Conversation Client service as a package for consumers

latest
npmnpm
Version
2.0.0
Version published
Maintainers
71
Created
Source

DXP AI CONVERSATION CLIENT SDK

Overview

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.

Purpose

  • Abstract the complexity of HTTP requests and OpenAPI interactions, enabling developers to easily integrate AI functionalities related to chat message processing and conversation rating.
  • Provide a consistent, strongly-typed TypeScript interface for seamless integration with the DXP AI Service.
  • Support both CommonJS (CJS) and ECMAScript Module (ESM) variants for flexible usage in various JavaScript environments.

Installation

Install the SDK package using your preferred package manager:

npm install @squiz/dxp-ai-conversation-client

Usage

1. Initialize the SDK 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();

2. Process Chat Messages

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);
});

3. Rate Conversations

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);
});

API Methods

  • 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.

Development & Contribution

If you need to extend or modify the SDK, please refer to the Contribution Guidelines in the DXP AI service repository.

Repository

The SDK source code and OpenAPI specification are located in the DXP AI service repository at:

packages/dxp-ai-conversation-client

Versioning and Release

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

Package last updated on 19 Jun 2025

Did you know?

Socket

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.

Install

Related posts