refactor(schema): extract shared public schemas (#33571)
This commit is contained in:
parent
60aba622ab
commit
516cfe4e09
130 changed files with 2014 additions and 1593 deletions
23
packages/schema/src/llm.ts
Normal file
23
packages/schema/src/llm.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
export * as LLM from "./llm"
|
||||
|
||||
import { Schema } from "effect"
|
||||
|
||||
export const ProviderMetadata = Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown))
|
||||
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: Schema.optional(Schema.String),
|
||||
}).annotate({ identifier: "Tool.FileContent" })
|
||||
|
||||
export const ToolContent = Schema.Union([ToolTextContent, ToolFileContent]).pipe(Schema.toTaggedUnion("type"))
|
||||
export type ToolContent = Schema.Schema.Type<typeof ToolContent>
|
||||
Loading…
Add table
Add a link
Reference in a new issue