context.call
method to make HTTP requests. We can create a custom fetch implementation that uses context.call
to make requests. By using context.call
, Upstash Workflow is the one making the HTTP request and waiting for the response, even if it takes too long to receive response from the LLM.
The following code snippet can also be generalized to work with other LLM SDKs, such as Anthropic or Google.
maxSteps
parameter must be greater than 1 when using tools to allow the model to process tool results and generate final responses. See the tool steps documentation for detailed explanation.generateText
cannot be called before any workflow step. Always have a step before generateText
. This could be a step which gets the prompt:
execute
function must be wrapped in a context.run()
call