bstp-agent-widget 0.2.9 → 0.2.11

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 CHANGED
@@ -101,6 +101,19 @@ export class AgentChatWidgetComponent implements AfterViewInit, OnDestroy {
101
101
  customerToken: 'jwt-token',
102
102
  language: 'en-US',
103
103
  },
104
+ // Agent config can be supplied by host app.
105
+ // baseUrl and genai.init still come from environment.json.
106
+ config: {
107
+ assistantId: 220,
108
+ assistants: [
109
+ { assistantKey: 'salesAgent', assistantId: 220, label: 'Sales Assistant' },
110
+ ],
111
+ },
112
+ ui: {
113
+ zIndex: 12000,
114
+ withinPortal: true,
115
+ fabPosition: { bottom: 16, right: 16 },
116
+ },
104
117
  // Optional. Default: /environment.json
105
118
  // environmentUrl: '/environment.json',
106
119
  });
@@ -112,19 +125,26 @@ export class AgentChatWidgetComponent implements AfterViewInit, OnDestroy {
112
125
  }
113
126
  ```
114
127
 
115
- 5. Provide `genai.config` in Angular app `public/environment.json`:
128
+ 5. Provide GenAI configuration in Angular app `public/environment.json`:
116
129
 
117
130
  ```json
118
131
  {
132
+ "url": {
133
+ "api": "https://...",
134
+ "apiPaths": {
135
+ "genai": "genai/api/v1"
136
+ }
137
+ },
119
138
  "genai": {
120
139
  "config": {
121
- "assistantId": 220,
122
- "url": "https://.../genai/api/v1"
140
+ "assistantId": 220
123
141
  }
124
142
  }
125
143
  }
126
144
  ```
127
145
 
146
+ Base URL is resolved from `url.api` + `url.apiPaths.genai`.
147
+
128
148
  # React Starter Kit
129
149
 
130
150
  A modern, enterprise-grade React Starter Kit built with TypeScript, providing a comprehensive foundation for building scalable web applications. This starter kit includes all the essential tools and configurations needed for modern React development.