summaryrefslogtreecommitdiff
path: root/internal/hexaiaction/action_document.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/hexaiaction/action_document.go')
-rw-r--r--internal/hexaiaction/action_document.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/hexaiaction/action_document.go b/internal/hexaiaction/action_document.go
new file mode 100644
index 0000000..c0d560a
--- /dev/null
+++ b/internal/hexaiaction/action_document.go
@@ -0,0 +1,17 @@
+package hexaiaction
+
+import "context"
+
+func init() {
+ registerActionHandler(ActionDocument, actionHandlerFunc(handleDocumentActionRequest))
+}
+
+func handleDocumentActionRequest(ctx context.Context, req actionRequest) (string, error) {
+ return handleDocumentAction(ctx, req.parts, req.cfg, req.client)
+}
+
+func handleDocumentAction(ctx context.Context, parts InputParts, cfg actionConfig, client chatDoer) (string, error) {
+ return runWithTimeout(ctx, timeout20s, func(cctx context.Context) (string, error) {
+ return runDocument(cctx, cfg, client, parts.Selection)
+ })
+}