/
Alex_Ural
/
opencode
Обзор
Документация
Войти
/
Alex_Ural
/
opencode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
packages/schema/src/llm.ts
28 строк
1 KB
Kit Langton
refactor(schema): tighten public contracts (#33771)
25 июн 2026, 20:10
Не верифицирован
25 июн 2026, 20:10
9e9d405
Код
Авторство
О чём код?
export * as LLM from "./llm" import { Schema } from "effect" import { optional } from "./schema" export const ProviderMetadata = Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown)).annotate({ identifier: "LLM.ProviderMetadata", }) export type ProviderMetadata = Schema.Schema.Type<typeof ProviderMetadata> export interface ToolTextContent extends Schema.Schema.Type<typeof ToolTextContent> {} export const ToolTextContent = Schema.Struct({ type: Schema.Literal("text"), text: Schema.String, }).annotate({ identifier: "Tool.TextContent" }) export interface ToolFileContent extends Schema.Schema.Type<typeof ToolFileContent> {} export const ToolFileContent = Schema.Struct({ type: Schema.Literal("file"), uri: Schema.String, mime: Schema.String, name: optional(Schema.String), }).annotate({ identifier: "Tool.FileContent" }) export const ToolContent = Schema.Union([ToolTextContent, ToolFileContent]) .pipe(Schema.toTaggedUnion("type")) .annotate({ identifier: "LLM.ToolContent" }) export type ToolContent = Schema.Schema.Type<typeof ToolContent>