curl
, here’s an example:
end
event with the output data. Here’s an example:
extra
object, such as temperature
, max_tokens
, and tools
. Similarly, arbitrary metadata can be passed in the metadata
object, user information can be reported in the userId
and userProps
fields, and tags can be added to the event.
Example with additional data:
templateVersionId
field to reference the template version used in the call.
error
field using an error
event.
feedback
field and a feedback
event.
parentRunId
field to link them together, under an “agent” run.
tool
and embed
.
thread.chat
event and the message
field.
Note that we must pass a parentRunId
here, which is the unique identifier of the current thread. Thread runs are opened and closed automatically, you don’t need to explicitly start or end them.
For a chat
event, a different parentRunId
means a different conversation thread with the user.
chat
run), it’s good practice to open an agent
run to encapsulate the agent’s logic.
This also allows us to see the isolated’s agent execution in the Traces tab of the Lunary UI.
runId
& parentRunId
here is the same as the previous chat
run), as 1 ID is used per user->assistant interaction.
message
fieldinput
is the prompt and output
is the llm’s responseinput
is the arguments and the output
is the tool’s resultchat
run using a feedback
event and the feedback
field.