refactor(search): isolate provider schemas
This commit is contained in:
parent
228db3dd9a
commit
97aa6713b5
14 changed files with 151 additions and 227 deletions
|
|
@ -2,16 +2,12 @@ export * as Search from "./search.js"
|
|||
|
||||
import { Schema } from "effect"
|
||||
import { IntegrationID } from "./integration-id.js"
|
||||
import { optional, PositiveInt } from "./schema.js"
|
||||
import { optional } from "./schema.js"
|
||||
|
||||
export interface Input extends Schema.Schema.Type<typeof Input> {}
|
||||
export const Input = Schema.Struct({
|
||||
query: Schema.String,
|
||||
providerID: IntegrationID.pipe(optional),
|
||||
numResults: PositiveInt.check(Schema.isLessThanOrEqualTo(20)).pipe(optional),
|
||||
livecrawl: Schema.Literals(["fallback", "preferred"]).pipe(optional),
|
||||
type: Schema.Literals(["auto", "fast", "deep"]).pipe(optional),
|
||||
contextMaxCharacters: PositiveInt.check(Schema.isLessThanOrEqualTo(50_000)).pipe(optional),
|
||||
}).annotate({ identifier: "Search.Input" })
|
||||
|
||||
export interface ProviderOutput extends Schema.Schema.Type<typeof ProviderOutput> {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue