MCPcopy Index your code
hub / github.com/coder/coder / publishChatConfigEvent

Function publishChatConfigEvent

coderd/exp_chats.go:141–161  ·  view source on GitHub ↗
(logger slog.Logger, ps dbpubsub.Pubsub, kind pubsub.ChatConfigEventKind, entityID uuid.UUID)

Source from the content-addressed store, hash-verified

139}
140
141func publishChatConfigEvent(logger slog.Logger, ps dbpubsub.Pubsub, kind pubsub.ChatConfigEventKind, entityID uuid.UUID) {
142 payload, err := json.Marshal(pubsub.ChatConfigEvent{
143 Kind: kind,
144 EntityID: entityID,
145 })
146 if err != nil {
147 logger.Error(context.Background(), "failed to marshal chat config event",
148 slog.F("kind", kind),
149 slog.F("entity_id", entityID),
150 slog.Error(err),
151 )
152 return
153 }
154 if err := ps.Publish(pubsub.ChatConfigEventChannel, payload); err != nil {
155 logger.Error(context.Background(), "failed to publish chat config event",
156 slog.F("kind", kind),
157 slog.F("entity_id", entityID),
158 slog.Error(err),
159 )
160 }
161}
162
163// EXPERIMENTAL: this endpoint is experimental and is subject to change.
164//

Callers 5

putChatAdvisorConfigMethod · 0.85
createChatModelConfigMethod · 0.85
updateChatModelConfigMethod · 0.85
deleteChatModelConfigMethod · 0.85

Calls 3

PublishMethod · 0.65
MarshalMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected