@rolatech/angular-services 20.3.3-beta.1 → 20.3.3-beta.2

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.
@@ -2829,7 +2829,7 @@ class AssistantStreamService {
2829
2829
  'client-id': this.environment.clientId,
2830
2830
  ...(init?.headers ?? {}),
2831
2831
  };
2832
- fetch(`${this.environment.baseUrl}/conversations/direct`, {
2832
+ fetch(`${this.environment.baseUrl}/conversations`, {
2833
2833
  method: 'POST',
2834
2834
  body: JSON.stringify(req),
2835
2835
  headers,
@@ -3004,6 +3004,9 @@ class AssistantStreamService {
3004
3004
  case 'group': {
3005
3005
  return { type: 'group', ...parsed };
3006
3006
  }
3007
+ case 'markdown': {
3008
+ return { type: 'markdown', ...parsed };
3009
+ }
3007
3010
  case 'json': {
3008
3011
  return { type: 'json', data: parsed };
3009
3012
  }
@@ -3075,17 +3078,12 @@ class ConversationService {
3075
3078
  if (!trimmed)
3076
3079
  return;
3077
3080
  // Append user message to timeline
3078
- this._messages$.next([
3079
- ...this._messages$.value,
3080
- { id: this.nextId(), role: 'user', text: trimmed, createdAt: Date.now() },
3081
- ]);
3081
+ this._messages$.next([...this._messages$.value, { id: this.nextId(), role: 'user', text: trimmed, createdAt: Date.now() }]);
3082
3082
  // Start/continue assistant stream
3083
3083
  this.cancel();
3084
3084
  this._typing$.next(true);
3085
3085
  this._streaming$.next(true); // ✅ start spinner as soon as we stream
3086
- this.streamSub = this.assistant
3087
- .stream({ message: trimmed, conversationId: this.conversationId })
3088
- .subscribe({
3086
+ this.streamSub = this.assistant.stream({ message: trimmed, conversationId: this.conversationId }).subscribe({
3089
3087
  next: (ev) => this.handleStreamEvent(ev),
3090
3088
  error: (e) => {
3091
3089
  this._typing$.next(false);
@@ -3127,6 +3125,12 @@ class ConversationService {
3127
3125
  this.pushAssistantSegment({ kind: 'group', item: g });
3128
3126
  break;
3129
3127
  }
3128
+ case 'markdown': {
3129
+ this.flushPending();
3130
+ const m = ev;
3131
+ this.pushAssistantSegment({ kind: 'markdown', item: m });
3132
+ break;
3133
+ }
3130
3134
  case 'json': {
3131
3135
  this.flushPending();
3132
3136
  const j = ev;
@@ -3270,10 +3274,7 @@ class ConversationService {
3270
3274
  this.ensureAssistantMessage();
3271
3275
  this.withCurrentAssistant((m) => ({
3272
3276
  ...m,
3273
- segments: [
3274
- ...(m.segments ?? []),
3275
- { kind: 'text', text: `⚠️ ${message || 'Unknown error'}` },
3276
- ],
3277
+ segments: [...(m.segments ?? []), { kind: 'text', text: `⚠️ ${message || 'Unknown error'}` }],
3277
3278
  error: message || 'Unknown error',
3278
3279
  }));
3279
3280
  }