Skip to content
代码片段 群组 项目
未验证 提交 eae3b95c 编辑于 作者: Jannik Lehmann's avatar Jannik Lehmann 提交者: GitLab
浏览文件

Apply 1 suggestion(s) to 1 file(s)


Co-authored-by: default avatarNicolas Dular <ndular@gitlab.com>
上级 4d748f51
No related branches found
No related tags found
无相关合并请求
...@@ -127,7 +127,7 @@ myFancyToggleToOpenChat.addEventListener('click', () => { ...@@ -127,7 +127,7 @@ myFancyToggleToOpenChat.addEventListener('click', () => {
#### Initiating GitLab Duo Chat with a pre-defined prompt #### Initiating GitLab Duo Chat with a pre-defined prompt
In some scenarios, you may want to direct users towards a specific topic or In some scenarios, you may want to direct users towards a specific topic or
query when they open GitLab Duo Chat. We have a utility function that will query when they open GitLab Duo Chat. We have a utility function that will
open DuoChat drawer and send a command in a queue for DuoChat to execute on. open DuoChat drawer and send a command in a queue for DuoChat to execute on.
This should trigger the loading state and the streaming with the given prompt. This should trigger the loading state and the streaming with the given prompt.
...@@ -375,7 +375,7 @@ The GraphQL Subscription for Chat behaves slightly different because it's user-c ...@@ -375,7 +375,7 @@ The GraphQL Subscription for Chat behaves slightly different because it's user-c
We therefore need to broadcast messages to multiple clients to keep them in sync. The `aiAction` mutation with the `chat` action behaves the following: We therefore need to broadcast messages to multiple clients to keep them in sync. The `aiAction` mutation with the `chat` action behaves the following:
1. All complete Chat messages (including messages from the user) are broadcasted with the `userId`, `aiAction: "chat"` as identifier. 1. All complete Chat messages (including messages from the user) are broadcasted with the `userId`, `aiAction: "chat"` as identifier.
1. Chunks from streamed Chat messages and currently used tools are broadcasted with the `userId`, `resourceId`, and the `clientSubscriptionId` from the mutation as identifier. 1. Chunks from streamed Chat messages are broadcasted with the `clientSubscriptionId` from the mutation as identifier.
Examples of GraphQL Subscriptions in a Vue component: Examples of GraphQL Subscriptions in a Vue component:
...@@ -417,8 +417,8 @@ Examples of GraphQL Subscriptions in a Vue component: ...@@ -417,8 +417,8 @@ Examples of GraphQL Subscriptions in a Vue component:
query: aiResponseSubscription, query: aiResponseSubscription,
variables() { variables() {
return { return {
aiAction: 'CHAT',
userId, // for example "gid://gitlab/User/1" userId, // for example "gid://gitlab/User/1"
resourceId, // can be either a resourceId (on Issue, Epic, etc. items), or userId
clientSubscriptionId // randomly generated identifier for every message clientSubscriptionId // randomly generated identifier for every message
htmlResponse: false, // important to bypass HTML processing on every chunk htmlResponse: false, // important to bypass HTML processing on every chunk
}; };
...@@ -433,8 +433,7 @@ Examples of GraphQL Subscriptions in a Vue component: ...@@ -433,8 +433,7 @@ Examples of GraphQL Subscriptions in a Vue component:
}, },
``` ```
Note that we still broadcast chat messages and currently used tools using the `userId` and `resourceId` as identifier. Please keep in mind that the clientSubscriptionId must be unique for every request. Reusing a clientSubscriptionId will cause several unwanted side effects in the subscription responses.
However, this is deprecated and should no longer be used. We want to remove `resourceId` on the subscription as part of [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/420296).
### Duo Chat GraphQL queries ### Duo Chat GraphQL queries
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册