Skip to content

Conversation

@kanat
Copy link
Contributor

@kanat kanat commented Nov 27, 2024

Link to Issue

https://linear.app/stream/issue/CHA-334/add-ai-related-user-events

Link to Spec

https://www.notion.so/stream-wiki/Q4-AI-use-cases-1386a5d7f9f680958001f1c382ec6f12

Backend PR

https://github.com/GetStream/chat/pull/7612

Summary

Add the following AI events for future AI integration:

  • ai_indicator.update
{
  "type": "ai_indicator.update",
  "cid": "messaging:general-3ac667a1-6113-4b16-b1e3-50dbff0ffb89",
  "channel_id": "general-3ac667a1-6113-4b16-b1e3-50dbff0ffb89",
  "channel_type": "messaging",
  "message_id": "aba120c6-c845-4c5a-968d-31ed0429c31e",
  "ai_state": "AI_STATE_ERROR",
  "ai_message": "something went wrong",
  "user": {
    "id": "ai-1e9666df-9b9e-429e-b7e4-e2f54446d5ac",
    "role": "user",
    "created_at": "2024-11-27T15:51:55.649597Z",
    "updated_at": "2024-11-27T15:51:55.649597Z",
    "last_active": "2024-11-27T15:51:55.668787Z",
    "banned": false,
    "online": true
  },
  "created_at": "2024-11-27T15:51:55.757904Z"
}
  • ai_indicator.stop
{
  "type": "ai_indicator.stop",
  "cid": "messaging:general-3ac667a1-6113-4b16-b1e3-50dbff0ffb89",
  "channel_id": "general-3ac667a1-6113-4b16-b1e3-50dbff0ffb89",
  "channel_type": "messaging",
  "user": {
    "id": "ai-1e9666df-9b9e-429e-b7e4-e2f54446d5ac",
    "role": "user",
    "created_at": "2024-11-27T15:51:55.649597Z",
    "updated_at": "2024-11-27T15:51:55.649597Z",
    "last_active": "2024-11-27T15:51:55.668787Z",
    "banned": false,
    "online": true
  },
  "created_at": "2024-11-27T15:51:55.803339Z"
}
  • ai_indicator.clear
{
  "type": "ai_indicator.clear",
  "cid": "messaging:general-a4ea1bed-f233-4021-b9f8-f9519367cefd",
  "channel_id": "general-a4ea1bed-f233-4021-b9f8-f9519367cefd",
  "channel_type": "messaging",
  "user": {
    "id": "ai-b076753a-830e-40b0-816d-0929bb73d7ce",
    "role": "user",
    "created_at": "2024-11-27T15:57:45.157276Z",
    "updated_at": "2024-11-27T15:57:45.157276Z",
    "last_active": "2024-11-27T15:57:45.177077Z",
    "banned": false,
    "online": true
  },
  "created_at": "2024-11-27T15:57:45.32967Z"
}

CLA

  • I have signed the Stream CLA (required).
  • Code changes are tested

@github-actions
Copy link
Contributor

github-actions bot commented Nov 27, 2024

Size Change: +2.48 kB (+0.54%)

Total Size: 461 kB

Filename Size Change
dist/browser.es.js 100 kB +576 B (+0.58%)
dist/browser.full-bundle.min.js 56.8 kB +142 B (+0.25%)
dist/browser.js 102 kB +592 B (+0.59%)
dist/index.es.js 100 kB +576 B (+0.58%)
dist/index.js 102 kB +594 B (+0.59%)

compressed-size-action

@kanat kanat changed the title [CHA-334] Add AI related user events feat: add AI related user events Nov 27, 2024
@kanat kanat requested a review from arnautov-anton November 27, 2024 18:56
Copy link
Contributor

@isekovanic isekovanic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@kanat kanat marked this pull request as draft November 28, 2024 19:44
@kanat
Copy link
Contributor Author

kanat commented Nov 28, 2024

Converted the PR to draft until we finalize the naming 👍

@kanat kanat marked this pull request as ready for review November 29, 2024 14:22
@kanat
Copy link
Contributor Author

kanat commented Nov 29, 2024

Converted back to Ready for Review since aligned with naming 👍

@kanat kanat requested a review from MartinCupela November 29, 2024 14:23
Copy link
Contributor

@isekovanic isekovanic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging this since everyone's in favor as discussed internally.

@isekovanic isekovanic merged commit b1d4249 into master Dec 3, 2024
5 checks passed
@isekovanic isekovanic deleted the ai-events branch December 3, 2024 13:11
@github-actions github-actions bot mentioned this pull request Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants