Skip to content

template

function template<Schemas extends readonly Constraint[]>(
segments: TemplateStringsArray,
...schemas: Schemas
): <E, R, CE, CR>(options: {
annotations?: Context<never>
audience?: readonly ("user" | "assistant")[]
completion?: {
readonly [K in string | number | symbol]?: (
input: string,
context: { arguments?: { [key: string]: string } } | undefined,
) => Effect<
ResourceCompletions<Schemas>[K] extends (
args: never[],
) => Effect<A, any, any>
? A
: never,
CE,
CR
>
}
content: (
uri: string,
...params: { readonly [K in string | number | symbol]: Schemas[K]["Type"] }
) => Effect<string | Uint8Array<ArrayBufferLike> | ReadResourceResult, E, R>
description?: string
mimeType?: string
name: string
priority?: number
}) => Effect<
Template,
never,
| Scope
| Exclude<R, RequestServices>
| Exclude<CR, RequestServices>
| Exclude<Schemas[number]["DecodingServices"], RequestServices>
| Exclude<Schemas[number]["EncodingServices"], RequestServices>
>

Defined in: Resources.ts:47

Uses Effect’s public tagged-template form; Effect compiles and decodes the route.

Type Parameter
Schemas extends readonly Constraint[]
Parameter Type
segments TemplateStringsArray
…schemas Schemas

<E, R, CE, CR>(options: { annotations?: Context<never>; audience?: readonly ("user" | "assistant")[]; completion?: { readonly [K in string | number | symbol]?: (input: string, context: { arguments?: { [key: string]: string } } | undefined) => Effect<ResourceCompletions<Schemas>[K] extends (args: never[]) => Effect<A, any, any> ? A : never, CE, CR> }; content: (uri: string, …params: { readonly [K in string | number | symbol]: Schemas[K][“Type”] }) => Effect<string | Uint8Array<ArrayBufferLike> | ReadResourceResult, E, R>; description?: string; mimeType?: string; name: string; priority?: number; }) => Effect<Template, never, | Scope | Exclude<R, RequestServices> | Exclude<CR, RequestServices> | Exclude<Schemas[number]["DecodingServices"], RequestServices> | Exclude<Schemas[number]["EncodingServices"], RequestServices>>