@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 44 lines 1.4 KB
Raw
1 import type * as kendra from "@distilled.cloud/aws/kendra";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Index } from "./SearchIndex.ts";
5
6 /**
7 * `SubmitFeedback` request with `IndexId` injected from the bound index.
8 */
9 export interface SubmitFeedbackRequest extends Omit<kendra.SubmitFeedbackRequest, "IndexId"> {}
10
11 /**
12 * Runtime binding for the `SubmitFeedback` operation (IAM action
13 * `kendra:SubmitFeedback`), scoped to one {@link Index}.
14 *
15 * Submits click and relevance feedback for a query's results — Kendra
16 * uses it to tune the index's relevance over time (incremental learning).
17 * Provide the implementation with
18 * `Effect.provide(AWS.Kendra.SubmitFeedbackHttp)`.
19 *
20 * ### Querying an Index
21 * **Example:** Submit Click Feedback
22 * ```typescript
23 * const submitFeedback = yield* AWS.Kendra.SubmitFeedback(index);
24 *
25 * yield* submitFeedback({
26 * QueryId: queryId,
27 * ClickFeedbackItems: [{ ResultId: resultId, ClickTime: new Date() }],
28 * });
29 * ```
30 *
31 * @binding
32 */
33 export interface SubmitFeedback extends Binding.Service<
34 SubmitFeedback,
35 "AWS.Kendra.SubmitFeedback",
36 (
37 index: Index,
38 ) => Effect.Effect<
39 (
40 request: SubmitFeedbackRequest,
41 ) => Effect.Effect<kendra.SubmitFeedbackResponse, kendra.SubmitFeedbackError>
42 >
43 > {}
44 export const SubmitFeedback = Binding.Service<SubmitFeedback>("AWS.Kendra.SubmitFeedback");