Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chat-core: support integrationDetails and conversationSummary field #35

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/chat-core](./chat-core.md) &gt; [AwsConnectCredentials](./chat-core.awsconnectcredentials.md) &gt; [contactId](./chat-core.awsconnectcredentials.contactid.md)

## AwsConnectCredentials.contactId property

The identifier of an AWS chat session.

**Signature:**

```typescript
contactId: string;
```
22 changes: 22 additions & 0 deletions packages/chat-core/docs/chat-core.awsconnectcredentials.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/chat-core](./chat-core.md) &gt; [AwsConnectCredentials](./chat-core.awsconnectcredentials.md)

## AwsConnectCredentials interface

AWS Connect handoff credentials.

**Signature:**

```typescript
export interface AwsConnectCredentials
```

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [contactId](./chat-core.awsconnectcredentials.contactid.md) | | string | The identifier of an AWS chat session. |
| [participantId](./chat-core.awsconnectcredentials.participantid.md) | | string | The identifier for a chat participant in AWS Connect. |
| [participantToken](./chat-core.awsconnectcredentials.participanttoken.md) | | string | The token used by the chat participant create connection. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/chat-core](./chat-core.md) &gt; [AwsConnectCredentials](./chat-core.awsconnectcredentials.md) &gt; [participantId](./chat-core.awsconnectcredentials.participantid.md)

## AwsConnectCredentials.participantId property

The identifier for a chat participant in AWS Connect.

**Signature:**

```typescript
participantId: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/chat-core](./chat-core.md) &gt; [AwsConnectCredentials](./chat-core.awsconnectcredentials.md) &gt; [participantToken](./chat-core.awsconnectcredentials.participanttoken.md)

## AwsConnectCredentials.participantToken property

The token used by the chat participant create connection.

**Signature:**

```typescript
participantToken: string;
```

## Remarks

The participant token is valid for the lifetime of a chat participant.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/chat-core](./chat-core.md) &gt; [AwsConnectHandoff](./chat-core.awsconnecthandoff.md) &gt; [credentials](./chat-core.awsconnecthandoff.credentials.md)

## AwsConnectHandoff.credentials property

AWS Connect handoff credentials.

**Signature:**

```typescript
credentials: AwsConnectCredentials;
```
20 changes: 20 additions & 0 deletions packages/chat-core/docs/chat-core.awsconnecthandoff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/chat-core](./chat-core.md) &gt; [AwsConnectHandoff](./chat-core.awsconnecthandoff.md)

## AwsConnectHandoff interface

Configurations for AWS Connect handoff.

**Signature:**

```typescript
export interface AwsConnectHandoff
```

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [credentials](./chat-core.awsconnecthandoff.credentials.md) | | [AwsConnectCredentials](./chat-core.awsconnectcredentials.md) | AWS Connect handoff credentials. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/chat-core](./chat-core.md) &gt; [IntegrationDetails](./chat-core.integrationdetails.md) &gt; [awsConnectHandoff](./chat-core.integrationdetails.awsconnecthandoff.md)

## IntegrationDetails.awsConnectHandoff property

Configurations for AWS Connect handoff.

**Signature:**

```typescript
awsConnectHandoff?: AwsConnectHandoff;
```
24 changes: 24 additions & 0 deletions packages/chat-core/docs/chat-core.integrationdetails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/chat-core](./chat-core.md) &gt; [IntegrationDetails](./chat-core.integrationdetails.md)

## IntegrationDetails interface

Integration details for the current conversation.

**Signature:**

```typescript
export interface IntegrationDetails
```

## Remarks

This is only present when the conversation is integrated with a third-party service, such as AWS Connect and Zendesk.

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [awsConnectHandoff?](./chat-core.integrationdetails.awsconnecthandoff.md) | | [AwsConnectHandoff](./chat-core.awsconnecthandoff.md) | _(Optional)_ Configurations for AWS Connect handoff. |

3 changes: 3 additions & 0 deletions packages/chat-core/docs/chat-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@

| Interface | Description |
| --- | --- |
| [AwsConnectCredentials](./chat-core.awsconnectcredentials.md) | AWS Connect handoff credentials. |
| [AwsConnectHandoff](./chat-core.awsconnecthandoff.md) | Configurations for AWS Connect handoff. |
| [ChatConfig](./chat-core.chatconfig.md) | The configuration options for [ChatCore](./chat-core.chatcore.md)<!-- -->. |
| [ChatCore](./chat-core.chatcore.md) | Provide methods for interacting with Chat API. |
| [EndEvent](./chat-core.endevent.md) | An event that indicates end of Chat stream. |
| [Endpoints](./chat-core.endpoints.md) | The URLs which are used when making requests to the Chat API. |
| [IntegrationDetails](./chat-core.integrationdetails.md) | Integration details for the current conversation. |
| [Message](./chat-core.message.md) | Represents a message within a conversation. |
| [MessageNotes](./chat-core.messagenotes.md) | Information relevant to the current state of the conversation, serving as the bot’s "memory" regarding what work it previously did to help determine future actions. |
| [MessageRequest](./chat-core.messagerequest.md) | A request to Chat API. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/chat-core](./chat-core.md) &gt; [MessageNotes](./chat-core.messagenotes.md) &gt; [conversationSummary](./chat-core.messagenotes.conversationsummary.md)

## MessageNotes.conversationSummary property

The summary of the conversation up to this point.

**Signature:**

```typescript
conversationSummary?: string;
```
1 change: 1 addition & 0 deletions packages/chat-core/docs/chat-core.messagenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This data will come from the API. As such, a user’s first request may have thi
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [collectedData?](./chat-core.messagenotes.collecteddata.md) | | Record&lt;string, unknown&gt; | _(Optional)_ Data collected from user in a conversation. |
| [conversationSummary?](./chat-core.messagenotes.conversationsummary.md) | | string | _(Optional)_ The summary of the conversation up to this point. |
| [currentGoal?](./chat-core.messagenotes.currentgoal.md) | | string | _(Optional)_ The goal of the latest message. |
| [currentStepIndices?](./chat-core.messagenotes.currentstepindices.md) | | number\[\] | _(Optional)_ The indices to traversed within the nested instruction array to access the target step. |
| [goalFirstMsgIndex?](./chat-core.messagenotes.goalfirstmsgindex.md) | | number | _(Optional)_ The index of the message that started the current goal. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/chat-core](./chat-core.md) &gt; [MessageResponse](./chat-core.messageresponse.md) &gt; [integrationDetails](./chat-core.messageresponse.integrationdetails.md)

## MessageResponse.integrationDetails property

Integration details for the current conversation.

**Signature:**

```typescript
integrationDetails?: IntegrationDetails;
```

## Remarks

This is only present when the conversation is integrated with a third-party service, such as AWS Connect and Zendesk.

1 change: 1 addition & 0 deletions packages/chat-core/docs/chat-core.messageresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface MessageResponse
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [conversationId?](./chat-core.messageresponse.conversationid.md) | | string | _(Optional)_ The id corresponds to the current conversation. |
| [integrationDetails?](./chat-core.messageresponse.integrationdetails.md) | | [IntegrationDetails](./chat-core.integrationdetails.md) | _(Optional)_ Integration details for the current conversation. |
| [message](./chat-core.messageresponse.message.md) | | [Message](./chat-core.message.md) | The generated reply to the latest message in the request. |
| [notes](./chat-core.messageresponse.notes.md) | | [MessageNotes](./chat-core.messagenotes.md) | Information relevant to the current state of the conversation, serving as the bot’s "memory" regarding what work it previously did to help determine future actions. |

19 changes: 19 additions & 0 deletions packages/chat-core/etc/chat-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ export class ApiError extends Error {
type?: string;
}

// @public
export interface AwsConnectCredentials {
contactId: string;
participantId: string;
participantToken: string;
}

// @public
export interface AwsConnectHandoff {
credentials: AwsConnectCredentials;
}

// @public
export interface ChatConfig {
apiKey: string;
Expand Down Expand Up @@ -61,6 +73,11 @@ export enum Environment {
SANDBOX = "SANDBOX"
}

// @public
export interface IntegrationDetails {
awsConnectHandoff?: AwsConnectHandoff;
}

// Warning: (ae-internal-missing-underscore) The name "InternalConfig" should be prefixed with an underscore because the declaration is marked as @internal
//
// @internal
Expand All @@ -79,6 +96,7 @@ export interface Message {
// @public
export interface MessageNotes {
collectedData?: Record<string, unknown>;
conversationSummary?: string;
currentGoal?: string;
currentStepIndices?: number[];
goalFirstMsgIndex?: number;
Expand All @@ -98,6 +116,7 @@ export interface MessageRequest {
// @public
export interface MessageResponse {
conversationId?: string;
integrationDetails?: IntegrationDetails;
message: Message;
notes: MessageNotes;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/chat-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yext/chat-core",
"version": "0.8.0",
"version": "0.8.1",
"description": "Typescript Networking Library for the Yext Chat API",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.mjs",
Expand Down
1 change: 1 addition & 0 deletions packages/chat-core/src/infra/ChatCoreImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export class ChatCoreImpl implements ChatCore {
conversationId: data.response.conversationId,
message: data.response.message,
notes: data.response.notes,
integrationDetails: data.response.integrationDetails,
};
}

Expand Down
2 changes: 2 additions & 0 deletions packages/chat-core/src/models/endpoints/MessageNotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ export interface MessageNotes {
goalFirstMsgIndex?: number;
/** A set of pre-generated replies given by the AI. */
suggestedReplies?: string[];
/** The summary of the conversation up to this point. */
conversationSummary?: string;
}
3 changes: 3 additions & 0 deletions packages/chat-core/src/models/endpoints/MessageResponse.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { IntegrationDetails } from "../integrations/IntegrationDetails";
import { Message } from "./Message";
import { MessageNotes } from "./MessageNotes";

Expand All @@ -18,4 +19,6 @@ export interface MessageResponse {
message: Message;
/** {@inheritDoc MessageNotes} */
notes: MessageNotes;
/** {@inheritdoc IntegrationDetails} */
integrationDetails?: IntegrationDetails;
}
7 changes: 7 additions & 0 deletions packages/chat-core/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ export { ApiError } from "./http/ApiError";
export { StreamEventCallback } from "./endpoints/stream/StreamEventCallback";

export { EnumOrLiteral } from "./utils/EnumOrLiteral";

export { IntegrationDetails } from "./integrations/IntegrationDetails";

export {
AwsConnectHandoff,
AwsConnectCredentials,
} from "./integrations/AwsConnect";
28 changes: 28 additions & 0 deletions packages/chat-core/src/models/integrations/AwsConnect.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Configurations for AWS Connect handoff.
*
* @public
*/
export interface AwsConnectHandoff {
/** {@inheritdoc AwsConnectCredentials} */
credentials: AwsConnectCredentials;
}

/**
* AWS Connect handoff credentials.
*
* @public
*/
export interface AwsConnectCredentials {
/** The identifier of an AWS chat session. */
contactId: string;
/** The identifier for a chat participant in AWS Connect. */
participantId: string;
/**
* The token used by the chat participant create connection.
*
* @remarks
* The participant token is valid for the lifetime of a chat participant.
*/
participantToken: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { AwsConnectHandoff } from "./AwsConnect";

/**
* Integration details for the current conversation.
*
* @public
*
* @remarks
* This is only present when the conversation is integrated with a third-party service, such as AWS Connect and Zendesk.
*/
export interface IntegrationDetails {
/** {@inheritdoc AwsConnectHandoff} */
awsConnectHandoff?: AwsConnectHandoff;
}
4 changes: 2 additions & 2 deletions packages/chat-core/test-browser-esm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/chat-core/test-node-cjs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading