(workspaceCtx *turnWorkspaceContext)
| 13 | ) |
| 14 | |
| 15 | func (p *Server) newStoreChatAttachmentFunc(workspaceCtx *turnWorkspaceContext) chattool.StoreFileFunc { |
| 16 | return func( |
| 17 | ctx context.Context, |
| 18 | name string, |
| 19 | detectName string, |
| 20 | data []byte, |
| 21 | ) (chattool.AttachmentMetadata, error) { |
| 22 | workspaceCtx.chatStateMu.Lock() |
| 23 | chatSnapshot := *workspaceCtx.currentChat |
| 24 | workspaceCtx.chatStateMu.Unlock() |
| 25 | |
| 26 | return p.storeChatAttachment(ctx, chatSnapshot, name, detectName, data) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func (p *Server) storeChatAttachment( |
| 31 | ctx context.Context, |
no test coverage detected