Merge branch 'dev' into kit/e2e-golden-path
This commit is contained in:
commit
dff7ccc384
8 changed files with 80 additions and 73 deletions
|
|
@ -730,28 +730,77 @@ export namespace Config {
|
||||||
})
|
})
|
||||||
export type Layout = z.infer<typeof Layout>
|
export type Layout = z.infer<typeof Layout>
|
||||||
|
|
||||||
|
export const Model = z
|
||||||
|
.object({
|
||||||
|
id: z.string(),
|
||||||
|
name: z.string(),
|
||||||
|
family: z.string().optional(),
|
||||||
|
release_date: z.string(),
|
||||||
|
attachment: z.boolean(),
|
||||||
|
reasoning: z.boolean(),
|
||||||
|
temperature: z.boolean(),
|
||||||
|
tool_call: z.boolean(),
|
||||||
|
interleaved: z
|
||||||
|
.union([
|
||||||
|
z.literal(true),
|
||||||
|
z
|
||||||
|
.object({
|
||||||
|
field: z.enum(["reasoning_content", "reasoning_details"]),
|
||||||
|
})
|
||||||
|
.strict(),
|
||||||
|
])
|
||||||
|
.optional(),
|
||||||
|
cost: z
|
||||||
|
.object({
|
||||||
|
input: z.number(),
|
||||||
|
output: z.number(),
|
||||||
|
cache_read: z.number().optional(),
|
||||||
|
cache_write: z.number().optional(),
|
||||||
|
context_over_200k: z
|
||||||
|
.object({
|
||||||
|
input: z.number(),
|
||||||
|
output: z.number(),
|
||||||
|
cache_read: z.number().optional(),
|
||||||
|
cache_write: z.number().optional(),
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
|
limit: z.object({
|
||||||
|
context: z.number(),
|
||||||
|
input: z.number().optional(),
|
||||||
|
output: z.number(),
|
||||||
|
}),
|
||||||
|
modalities: z
|
||||||
|
.object({
|
||||||
|
input: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
|
||||||
|
output: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
|
experimental: z.boolean().optional(),
|
||||||
|
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
|
||||||
|
options: z.record(z.string(), z.any()),
|
||||||
|
headers: z.record(z.string(), z.string()).optional(),
|
||||||
|
provider: z.object({ npm: z.string().optional(), api: z.string().optional() }).optional(),
|
||||||
|
variants: z
|
||||||
|
.record(
|
||||||
|
z.string(),
|
||||||
|
z
|
||||||
|
.object({
|
||||||
|
disabled: z.boolean().optional().describe("Disable this variant for the model"),
|
||||||
|
})
|
||||||
|
.catchall(z.any()),
|
||||||
|
)
|
||||||
|
.optional()
|
||||||
|
.describe("Variant-specific configuration"),
|
||||||
|
})
|
||||||
|
.partial()
|
||||||
|
|
||||||
export const Provider = ModelsDev.Provider.partial()
|
export const Provider = ModelsDev.Provider.partial()
|
||||||
.extend({
|
.extend({
|
||||||
whitelist: z.array(z.string()).optional(),
|
whitelist: z.array(z.string()).optional(),
|
||||||
blacklist: z.array(z.string()).optional(),
|
blacklist: z.array(z.string()).optional(),
|
||||||
models: z
|
models: z.record(z.string(), Model).optional(),
|
||||||
.record(
|
|
||||||
z.string(),
|
|
||||||
ModelsDev.Model.partial().extend({
|
|
||||||
variants: z
|
|
||||||
.record(
|
|
||||||
z.string(),
|
|
||||||
z
|
|
||||||
.object({
|
|
||||||
disabled: z.boolean().optional().describe("Disable this variant for the model"),
|
|
||||||
})
|
|
||||||
.catchall(z.any()),
|
|
||||||
)
|
|
||||||
.optional()
|
|
||||||
.describe("Variant-specific configuration"),
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.optional(),
|
|
||||||
options: z
|
options: z
|
||||||
.object({
|
.object({
|
||||||
apiKey: z.string().optional(),
|
apiKey: z.string().optional(),
|
||||||
|
|
|
||||||
|
|
@ -61,12 +61,8 @@ export namespace ModelsDev {
|
||||||
output: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
|
output: z.array(z.enum(["text", "audio", "image", "video", "pdf"])),
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
experimental: z.boolean().optional(),
|
|
||||||
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
|
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
|
||||||
options: z.record(z.string(), z.any()),
|
|
||||||
headers: z.record(z.string(), z.string()).optional(),
|
|
||||||
provider: z.object({ npm: z.string().optional(), api: z.string().optional() }).optional(),
|
provider: z.object({ npm: z.string().optional(), api: z.string().optional() }).optional(),
|
||||||
variants: z.record(z.string(), z.record(z.string(), z.any())).optional(),
|
|
||||||
})
|
})
|
||||||
export type Model = z.infer<typeof Model>
|
export type Model = z.infer<typeof Model>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -909,8 +909,8 @@ export namespace Provider {
|
||||||
npm: model.provider?.npm ?? provider.npm ?? "@ai-sdk/openai-compatible",
|
npm: model.provider?.npm ?? provider.npm ?? "@ai-sdk/openai-compatible",
|
||||||
},
|
},
|
||||||
status: model.status ?? "active",
|
status: model.status ?? "active",
|
||||||
headers: model.headers ?? {},
|
headers: {},
|
||||||
options: model.options ?? {},
|
options: {},
|
||||||
cost: {
|
cost: {
|
||||||
input: model.cost?.input ?? 0,
|
input: model.cost?.input ?? 0,
|
||||||
output: model.cost?.output ?? 0,
|
output: model.cost?.output ?? 0,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import { Provider } from "@/provider/provider"
|
import { Provider } from "@/provider/provider"
|
||||||
import { Log } from "@/util/log"
|
import { Log } from "@/util/log"
|
||||||
import { Cause, Effect, Layer, Record, ServiceMap } from "effect"
|
import { Effect, Layer, Record, ServiceMap } from "effect"
|
||||||
import * as Queue from "effect/Queue"
|
|
||||||
import * as Stream from "effect/Stream"
|
import * as Stream from "effect/Stream"
|
||||||
import { streamText, wrapLanguageModel, type ModelMessage, type Tool, tool, jsonSchema } from "ai"
|
import { streamText, wrapLanguageModel, type ModelMessage, type Tool, tool, jsonSchema } from "ai"
|
||||||
import { mergeDeep, pipe } from "remeda"
|
import { mergeDeep, pipe } from "remeda"
|
||||||
|
|
|
||||||
|
|
@ -756,7 +756,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
||||||
}
|
}
|
||||||
const model = input.model ?? agent.model ?? (yield* lastModel(input.sessionID))
|
const model = input.model ?? agent.model ?? (yield* lastModel(input.sessionID))
|
||||||
const userMsg: MessageV2.User = {
|
const userMsg: MessageV2.User = {
|
||||||
id: MessageID.ascending(),
|
id: input.messageID ?? MessageID.ascending(),
|
||||||
sessionID: input.sessionID,
|
sessionID: input.sessionID,
|
||||||
time: { created: Date.now() },
|
time: { created: Date.now() },
|
||||||
role: "user",
|
role: "user",
|
||||||
|
|
@ -1827,6 +1827,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
|
||||||
|
|
||||||
export const ShellInput = z.object({
|
export const ShellInput = z.object({
|
||||||
sessionID: SessionID.zod,
|
sessionID: SessionID.zod,
|
||||||
|
messageID: MessageID.zod.optional(),
|
||||||
agent: z.string(),
|
agent: z.string(),
|
||||||
model: z
|
model: z
|
||||||
.object({
|
.object({
|
||||||
|
|
|
||||||
|
|
@ -2231,6 +2231,7 @@ export class Session2 extends HeyApiClient {
|
||||||
sessionID: string
|
sessionID: string
|
||||||
directory?: string
|
directory?: string
|
||||||
workspace?: string
|
workspace?: string
|
||||||
|
messageID?: string
|
||||||
agent?: string
|
agent?: string
|
||||||
model?: {
|
model?: {
|
||||||
providerID: string
|
providerID: string
|
||||||
|
|
@ -2248,6 +2249,7 @@ export class Session2 extends HeyApiClient {
|
||||||
{ in: "path", key: "sessionID" },
|
{ in: "path", key: "sessionID" },
|
||||||
{ in: "query", key: "directory" },
|
{ in: "query", key: "directory" },
|
||||||
{ in: "query", key: "workspace" },
|
{ in: "query", key: "workspace" },
|
||||||
|
{ in: "body", key: "messageID" },
|
||||||
{ in: "body", key: "agent" },
|
{ in: "body", key: "agent" },
|
||||||
{ in: "body", key: "model" },
|
{ in: "body", key: "model" },
|
||||||
{ in: "body", key: "command" },
|
{ in: "body", key: "command" },
|
||||||
|
|
|
||||||
|
|
@ -3815,6 +3815,7 @@ export type SessionCommandResponse = SessionCommandResponses[keyof SessionComman
|
||||||
|
|
||||||
export type SessionShellData = {
|
export type SessionShellData = {
|
||||||
body?: {
|
body?: {
|
||||||
|
messageID?: string
|
||||||
agent: string
|
agent: string
|
||||||
model?: {
|
model?: {
|
||||||
providerID: string
|
providerID: string
|
||||||
|
|
@ -4167,23 +4168,11 @@ export type ProviderListResponses = {
|
||||||
input: Array<"text" | "audio" | "image" | "video" | "pdf">
|
input: Array<"text" | "audio" | "image" | "video" | "pdf">
|
||||||
output: Array<"text" | "audio" | "image" | "video" | "pdf">
|
output: Array<"text" | "audio" | "image" | "video" | "pdf">
|
||||||
}
|
}
|
||||||
experimental?: boolean
|
|
||||||
status?: "alpha" | "beta" | "deprecated"
|
status?: "alpha" | "beta" | "deprecated"
|
||||||
options: {
|
|
||||||
[key: string]: unknown
|
|
||||||
}
|
|
||||||
headers?: {
|
|
||||||
[key: string]: string
|
|
||||||
}
|
|
||||||
provider?: {
|
provider?: {
|
||||||
npm?: string
|
npm?: string
|
||||||
api?: string
|
api?: string
|
||||||
}
|
}
|
||||||
variants?: {
|
|
||||||
[key: string]: {
|
|
||||||
[key: string]: unknown
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}>
|
}>
|
||||||
|
|
|
||||||
|
|
@ -3942,6 +3942,10 @@
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"messageID": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^msg.*"
|
||||||
|
},
|
||||||
"agent": {
|
"agent": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
@ -4740,29 +4744,10 @@
|
||||||
},
|
},
|
||||||
"required": ["input", "output"]
|
"required": ["input", "output"]
|
||||||
},
|
},
|
||||||
"experimental": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"status": {
|
"status": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["alpha", "beta", "deprecated"]
|
"enum": ["alpha", "beta", "deprecated"]
|
||||||
},
|
},
|
||||||
"options": {
|
|
||||||
"type": "object",
|
|
||||||
"propertyNames": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"additionalProperties": {}
|
|
||||||
},
|
|
||||||
"headers": {
|
|
||||||
"type": "object",
|
|
||||||
"propertyNames": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"provider": {
|
"provider": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -4773,19 +4758,6 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"variants": {
|
|
||||||
"type": "object",
|
|
||||||
"propertyNames": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "object",
|
|
||||||
"propertyNames": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"additionalProperties": {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
|
@ -4796,8 +4768,7 @@
|
||||||
"reasoning",
|
"reasoning",
|
||||||
"temperature",
|
"temperature",
|
||||||
"tool_call",
|
"tool_call",
|
||||||
"limit",
|
"limit"
|
||||||
"options"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue