@@ -11,7 +11,6 @@ import { openaiCompatible } from '@cortexluna/openai-compatible'
1111import {
1212 bindPromptTemplate ,
1313 bindPromptTemplateToObject ,
14- generatateObject ,
1514 promptTemplate
1615} from 'cortexluna'
1716
@@ -42,12 +41,17 @@ describe('Sentiment Analysis Workflow', () => {
4241 type IfNodeInput = Record < string , unknown >
4342 type IfNodeOutput = Record < string , boolean >
4443
45- type VariableConfig = { name : string ; type : 'input' | 'context' } | string
44+ type VariableConfig =
45+ | { name : string ; type : 'input' | 'context' }
46+ | string
4647
4748 const ifNode : NodeDefinition < IfNodeInput , IfNodeOutput > = {
4849 inputSchema : ( node : WorkflowNode ) => {
4950 const config = node . config as
50- | { expressions : Record < string , string > ; variables ?: VariableConfig [ ] }
51+ | {
52+ expressions : Record < string , string >
53+ variables ?: VariableConfig [ ]
54+ }
5155 | undefined
5256 if ( ! config ) return z . record ( z . unknown ( ) )
5357
@@ -62,9 +66,11 @@ describe('Sentiment Analysis Workflow', () => {
6266 const varConfig = config . variables ?. find (
6367 ( vc ) => ( typeof vc === 'string' ? vc : vc . name ) === v
6468 )
65- if ( ! varConfig ||
66- ( typeof varConfig === 'string' ) ||
67- varConfig . type === 'input' ) {
69+ if (
70+ ! varConfig ||
71+ typeof varConfig === 'string' ||
72+ varConfig . type === 'input'
73+ ) {
6874 inputFields [ v ] = z . unknown ( )
6975 }
7076 } )
@@ -84,7 +90,10 @@ describe('Sentiment Analysis Workflow', () => {
8490 } ,
8591 run : async ( input , context , node ) => {
8692 const config = node ?. config as
87- | { expressions : Record < string , string > ; variables ?: VariableConfig [ ] }
93+ | {
94+ expressions : Record < string , string >
95+ variables ?: VariableConfig [ ]
96+ }
8897 | undefined
8998 if ( ! config )
9099 throw new Error ( 'If node requires config with expressions' )
@@ -95,8 +104,12 @@ describe('Sentiment Analysis Workflow', () => {
95104 // Resolve variables from context if specified
96105 if ( config . variables ) {
97106 config . variables . forEach ( ( varConfig ) => {
98- if ( typeof varConfig === 'object' && varConfig . type === 'context' ) {
99- evalContext [ varConfig . name ] = context . variables [ varConfig . name ]
107+ if (
108+ typeof varConfig === 'object' &&
109+ varConfig . type === 'context'
110+ ) {
111+ evalContext [ varConfig . name ] =
112+ context . variables [ varConfig . name ]
100113 }
101114 } )
102115 }
@@ -230,9 +243,7 @@ describe('Sentiment Analysis Workflow', () => {
230243 if1 : 'multisentiment === true' ,
231244 elseif1 : 'multisentiment === false'
232245 } ,
233- variables : [
234- { name : 'multisentiment' , type : 'context' }
235- ]
246+ variables : [ { name : 'multisentiment' , type : 'context' } ]
236247 }
237248 } ,
238249 {
0 commit comments