This commit updates the KurtOpenAI adapter to handle the case of multiple parallel tool calls from the LLM, when being used with the generateWithOptionalTools method of Kurt.
In theory it would make sense to handle this case for generateStructuredData too, but in practice I cannot get OpenAI to respond with parallel tool calls when we are using tool_choice: { function: {...} } as we do in that method - it seems as though this option prevents parallel tool calls. If we can get this behavior to surface in practice in the future we can add logic and tests to handle that case.
Note that this resolves part of issue #33 - it resolves it for the OpenAI adapter, but not the Vertex AI adapter.
This commit updates the
KurtOpenAI
adapter to handle the case of multiple parallel tool calls from the LLM, when being used with thegenerateWithOptionalTools
method ofKurt
.In theory it would make sense to handle this case for
generateStructuredData
too, but in practice I cannot get OpenAI to respond with parallel tool calls when we are usingtool_choice: { function: {...} }
as we do in that method - it seems as though this option prevents parallel tool calls. If we can get this behavior to surface in practice in the future we can add logic and tests to handle that case.Note that this resolves part of issue #33 - it resolves it for the OpenAI adapter, but not the Vertex AI adapter.