Skip to content

Commit db7b3f1

Browse files
committed
feat(ui/circuits): add BiasNodeSchema and update NodeSchema
Introduced BiasNodeSchema to define a new node type with fields for featureType, nodeId, layer, ctxIdx, and isFromQkTracing. Updated NodeSchema to include BiasNodeSchema, enhancing the flexibility of node representation in the circuit.
1 parent 8da134c commit db7b3f1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ui-ssr/src/types/circuit.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,22 @@ export const LogitNodeSchema = z.object({
5757

5858
export type LogitNode = z.infer<typeof LogitNodeSchema>
5959

60+
export const BiasNodeSchema = z.object({
61+
featureType: z.literal('bias'),
62+
nodeId: z.string(),
63+
layer: z.number(),
64+
ctxIdx: z.number(),
65+
isFromQkTracing: z.boolean().default(false),
66+
})
67+
68+
export type BiasNode = z.infer<typeof BiasNodeSchema>
69+
6070
export const NodeSchema = z.union([
6171
FeatureNodeSchema,
6272
TokenNodeSchema,
6373
ErrorNodeSchema,
6474
LogitNodeSchema,
75+
BiasNodeSchema,
6576
])
6677

6778
export type Node = z.infer<typeof NodeSchema>

0 commit comments

Comments
 (0)