repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import { z } from 'zod'; |
| #2 | |
| #3 | /** |
| #4 | * LLM message role types |
| #5 | */ |
| #6 | export const lLMRoleTypeSchema = z.union([ |
| #7 | z.literal('user'), |
| #8 | z.literal('system'), |
| #9 | z.literal('assistant'), |
| #10 | z.literal('function'), |
| #11 | ]); |
| #12 | |
| #13 | /** |
| #14 | * LLM message structure |
| #15 | */ |
| #16 | export const lLMMessageSchema = z.object({ |
| #17 | /** |
| #18 | * Message content text |
| #19 | */ |
| #20 | content: z.string(), |
| #21 | /** |
| #22 | * Role of the message sender |
| #23 | */ |
| #24 | role: lLMRoleTypeSchema, |
| #25 | }); |
| #26 | |
| #27 | /** |
| #28 | * Array of LLM chat messages |
| #29 | */ |
| #30 | export const lLMChatsSchema = z.array(lLMMessageSchema); |
| #31 | |
| #32 | /** |
| #33 | * LLM model parameters for fine-tuning behavior |
| #34 | */ |
| #35 | export const lLMParamsSchema = z.object({ |
| #36 | /** |
| #37 | * Frequency penalty to reduce repetition |
| #38 | * @default 0 |
| #39 | */ |
| #40 | frequency_penalty: z.number().optional().default(0), |
| #41 | /** |
| #42 | * Maximum number of tokens to generate |
| #43 | */ |
| #44 | max_tokens: z.number().optional(), |
| #45 | /** |
| #46 | * Presence penalty to encourage topic diversity |
| #47 | * @default 0 |
| #48 | */ |
| #49 | presence_penalty: z.number().optional().default(0), |
| #50 | /** |
| #51 | * Sampling temperature for randomness control |
| #52 | * @default 0 |
| #53 | */ |
| #54 | temperature: z.number().optional().default(0), |
| #55 | /** |
| #56 | * Top-p sampling for nucleus sampling |
| #57 | * @default 1 |
| #58 | */ |
| #59 | top_p: z.number().optional().default(1), |
| #60 | }); |
| #61 | |
| #62 | /** |
| #63 | * Knowledge Base Item Schema |
| #64 | */ |
| #65 | export const knowledgeBaseItemSchema = z.object({ |
| #66 | avatar: z.string().nullable(), |
| #67 | createdAt: z.date(), |
| #68 | description: z.string().optional().nullable(), |
| #69 | enabled: z.boolean().optional(), |
| #70 | id: z.string(), |
| #71 | isPublic: z.boolean().nullable(), |
| #72 | name: z.string(), |
| #73 | settings: z.any(), |
| #74 | type: z.string().nullable(), |
| #75 | updatedAt: z.date(), |
| #76 | }); |
| #77 | |
| #78 | export type KnowledgeBaseItem = z.infer<typeof knowledgeBaseItemSchema>; |
| #79 | |
| #80 | |
| #81 |