llm.ts 960 B

1234567891011121314151617181920212223
  1. export * as LLM from "./llm"
  2. import { Schema } from "effect"
  3. export const ProviderMetadata = Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown))
  4. export type ProviderMetadata = Schema.Schema.Type<typeof ProviderMetadata>
  5. export interface ToolTextContent extends Schema.Schema.Type<typeof ToolTextContent> {}
  6. export const ToolTextContent = Schema.Struct({
  7. type: Schema.Literal("text"),
  8. text: Schema.String,
  9. }).annotate({ identifier: "Tool.TextContent" })
  10. export interface ToolFileContent extends Schema.Schema.Type<typeof ToolFileContent> {}
  11. export const ToolFileContent = Schema.Struct({
  12. type: Schema.Literal("file"),
  13. uri: Schema.String,
  14. mime: Schema.String,
  15. name: Schema.optional(Schema.String),
  16. }).annotate({ identifier: "Tool.FileContent" })
  17. export const ToolContent = Schema.Union([ToolTextContent, ToolFileContent]).pipe(Schema.toTaggedUnion("type"))
  18. export type ToolContent = Schema.Schema.Type<typeof ToolContent>