@go1/go1-embedding-react-sdk 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -18
- package/dist/README.md +29 -18
- package/dist/common/types.d.ts +9 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,25 +60,37 @@ interface ThemeInformation {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* Used to
|
|
64
|
-
* example:
|
|
65
|
-
* {
|
|
66
|
-
* id: 341134,
|
|
67
|
-
* shouldShowHeading: false
|
|
68
|
-
* }
|
|
63
|
+
* Used to configure the `ai-chat` feature
|
|
69
64
|
*/
|
|
70
|
-
interface
|
|
71
|
-
|
|
65
|
+
export interface FeatureAttributesAIChat {
|
|
66
|
+
experience: 'manager' | 'learner';
|
|
67
|
+
intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirational';
|
|
68
|
+
message?: string; // The desired message to start the chat, which will be shown to the user
|
|
69
|
+
existingSkills?: string[]; // max items 7, any more are discarded
|
|
70
|
+
desiredSkills?: string[]; // max items 7, any more are discarded
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type FeatureAttributes = FeatureAttributesAIChat
|
|
74
|
+
|
|
75
|
+
export interface AdditionalUserInfo {
|
|
76
|
+
jobTitle: string;
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
interface InitOptions {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
/** Mandatory identifier for the embedded feature */
|
|
81
|
+
feature: 'ai-chat' | 'content-hub' | 'preview';
|
|
82
|
+
/** Optional parameters to configure the feature. See associated types for examples */
|
|
83
|
+
featureAttributes?: FeatureAttributes;
|
|
84
|
+
/** Optional Go1 portal URL, used for login purposes if no `oneTimeToken` is provided */
|
|
85
|
+
portalURL?: string;
|
|
86
|
+
/** Optional function that is invoked when the Go1 content view emits a message */
|
|
87
|
+
onGo1MessageReceived?: OnGo1MessageReceived;
|
|
88
|
+
/** Optional end user information that can enhance the context and provide a better experience. No PII is needed, please do not send any. */
|
|
89
|
+
additionalUserInfo?: AdditionalUserInfo;
|
|
90
|
+
/** Optional UI configuration */
|
|
91
|
+
themeInformation?: ThemeInformation
|
|
92
|
+
/** Optional token that is used to pre-authorize the user without them needing to log in */
|
|
93
|
+
oneTimeToken?: string;
|
|
82
94
|
}
|
|
83
95
|
```
|
|
84
96
|
|
|
@@ -109,12 +121,11 @@ const options = useMemo<ContentViewProps>(() => {
|
|
|
109
121
|
feature: 'ai-chat',
|
|
110
122
|
portalURL: 'learning-incorporated-usa.mygo1.com',
|
|
111
123
|
featureAttributes: {
|
|
112
|
-
|
|
124
|
+
experience: 'manager',
|
|
113
125
|
},
|
|
114
126
|
onGo1MessageReceived,
|
|
115
127
|
additionalUserInfo: {
|
|
116
|
-
|
|
117
|
-
goals: ['leadership', 'management']
|
|
128
|
+
jobTitle: 'Sales development representative'
|
|
118
129
|
},
|
|
119
130
|
themeInformation: {
|
|
120
131
|
accent: '#0437F2'
|
package/dist/README.md
CHANGED
|
@@ -60,25 +60,37 @@ interface ThemeInformation {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* Used to
|
|
64
|
-
* example:
|
|
65
|
-
* {
|
|
66
|
-
* id: 341134,
|
|
67
|
-
* shouldShowHeading: false
|
|
68
|
-
* }
|
|
63
|
+
* Used to configure the `ai-chat` feature
|
|
69
64
|
*/
|
|
70
|
-
interface
|
|
71
|
-
|
|
65
|
+
export interface FeatureAttributesAIChat {
|
|
66
|
+
experience: 'manager' | 'learner';
|
|
67
|
+
intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirational';
|
|
68
|
+
message?: string; // The desired message to start the chat, which will be shown to the user
|
|
69
|
+
existingSkills?: string[]; // max items 7, any more are discarded
|
|
70
|
+
desiredSkills?: string[]; // max items 7, any more are discarded
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type FeatureAttributes = FeatureAttributesAIChat
|
|
74
|
+
|
|
75
|
+
export interface AdditionalUserInfo {
|
|
76
|
+
jobTitle: string;
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
interface InitOptions {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
/** Mandatory identifier for the embedded feature */
|
|
81
|
+
feature: 'ai-chat' | 'content-hub' | 'preview';
|
|
82
|
+
/** Optional parameters to configure the feature. See associated types for examples */
|
|
83
|
+
featureAttributes?: FeatureAttributes;
|
|
84
|
+
/** Optional Go1 portal URL, used for login purposes if no `oneTimeToken` is provided */
|
|
85
|
+
portalURL?: string;
|
|
86
|
+
/** Optional function that is invoked when the Go1 content view emits a message */
|
|
87
|
+
onGo1MessageReceived?: OnGo1MessageReceived;
|
|
88
|
+
/** Optional end user information that can enhance the context and provide a better experience. No PII is needed, please do not send any. */
|
|
89
|
+
additionalUserInfo?: AdditionalUserInfo;
|
|
90
|
+
/** Optional UI configuration */
|
|
91
|
+
themeInformation?: ThemeInformation
|
|
92
|
+
/** Optional token that is used to pre-authorize the user without them needing to log in */
|
|
93
|
+
oneTimeToken?: string;
|
|
82
94
|
}
|
|
83
95
|
```
|
|
84
96
|
|
|
@@ -109,12 +121,11 @@ const options = useMemo<ContentViewProps>(() => {
|
|
|
109
121
|
feature: 'ai-chat',
|
|
110
122
|
portalURL: 'learning-incorporated-usa.mygo1.com',
|
|
111
123
|
featureAttributes: {
|
|
112
|
-
|
|
124
|
+
experience: 'manager',
|
|
113
125
|
},
|
|
114
126
|
onGo1MessageReceived,
|
|
115
127
|
additionalUserInfo: {
|
|
116
|
-
|
|
117
|
-
goals: ['leadership', 'management']
|
|
128
|
+
jobTitle: 'Sales development representative'
|
|
118
129
|
},
|
|
119
130
|
themeInformation: {
|
|
120
131
|
accent: '#0437F2'
|
package/dist/common/types.d.ts
CHANGED
|
@@ -15,14 +15,19 @@ export interface Go1Message {
|
|
|
15
15
|
type: string;
|
|
16
16
|
payload?: any;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
19
|
-
|
|
18
|
+
export interface FeatureAttributesAIChat {
|
|
19
|
+
experience: 'manager' | 'learner';
|
|
20
|
+
intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirational';
|
|
21
|
+
message?: string;
|
|
22
|
+
existingSkills?: string[];
|
|
23
|
+
desiredSkills?: string[];
|
|
20
24
|
}
|
|
25
|
+
export type FeatureAttributes = FeatureAttributesAIChat;
|
|
21
26
|
export interface AdditionalUserInfo {
|
|
22
|
-
|
|
27
|
+
jobTitle: string;
|
|
23
28
|
}
|
|
24
29
|
export interface InitOptions {
|
|
25
|
-
feature:
|
|
30
|
+
feature: 'ai-chat' | 'content-hub' | 'preview';
|
|
26
31
|
iframeParentId?: string;
|
|
27
32
|
iframeParentElement?: HTMLElement;
|
|
28
33
|
featureAttributes?: FeatureAttributes;
|