LLM
calls.
Node
and write your own tool for it.
Each Trellis LLM
node is effectively one call to the OpenAI API, so we’ll need two LLM
nodes for our DAG.
LLM
class from the trellis
package.
LLM
class only requires a name
to be initialized. messages
is also very important, but
Trellis lets you set it using set_messages
or through the constructor. In this case, we’ll use the constructor,
and we’ll use set_messages
for the next LLM call.
Since our prompt doesn’t have any variadic input, we can leave the input schema input_s
blank.
Other than stream
, you can set any other arguments that you’d expect within the OpenAI API spec for chat completions.
set_messages
this time to set the messages. In the messages, we’re using {cat_fact_1}
and {cat_fact_2}
to reference the outputs of the previous Node
s.
These will be filled in when we connect the nodes together through edges in the next section.
Node
s together in a DAG
.