-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error "No function_call in message" on TaggingChain #2362
Comments
🤖 Hello, Thank you for reaching out and providing detailed information about the issue you're experiencing. The error message you're seeing, "No function_call in message", is typically thrown when the language model (LLM) you're using does not support OpenAI function calling. The Here's the relevant part of the code from the /**
* Function that creates a tagging chain from a Zod schema. It converts
* the Zod schema to a JSON schema using the zodToJsonSchema function and
* then calls createTaggingChain with the converted schema.
* @param schema The Zod schema which extracted data should match.
* @param llm LLM to use in the chain. Must support OpenAI function calling.
* @param options Options for creating the tagging chain.
* @returns A new instance of LLMChain configured for tagging.
*/
export function createTaggingChainFromZod(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
schema: z.ZodObject<any, any, any, any>,
llm: ChatOpenAI,
options?: TaggingChainOptions
) {
return createTaggingChain(
zodToJsonSchema(schema) as JsonSchema7ObjectType,
llm,
options
);
} You can find this in the langchain/src/chains/openai_functions/tagging.ts file. If the LLM you're using does not support OpenAI function calling, you'll need to use an LLM that does, or modify your existing LLM to add this support. However, since you mentioned that the error occurs intermittently, it might be due to some other factors as well. It could be related to the specific input you're processing at the time the error occurs, or it could be a timing issue where the function call is not ready when the chain is run. To help narrow down the cause, could you provide more information about the specific circumstances when the error occurs? For example, does it happen with specific inputs or after a certain amount of time or number of requests? Any additional information you can provide will be helpful in diagnosing the issue. Best, SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Hi, @AlexPagnotta! I'm Dosu, and I'm here to help the langchainjs team manage their backlog. I wanted to let you know that we are marking this issue as stale. Based on the information provided, it seems that you were experiencing a random error message stating "No function_call in message" when using the tagging chain from the createTaggingChainFromZod method. It appears that the cause of the error is unknown, and you were unsure why this was happening since the function is directly added by the chain. In response, Dosubot suggested that this error message is typically thrown when the language model being used does not support OpenAI function calling. Dosubot provided code snippets and suggested using an LLM that supports OpenAI function calling or modifying the existing LLM to add this support. Now, we would like to know if this issue is still relevant to the latest version of the langchainjs repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days. Thank you for your understanding and cooperation. Let us know if you have any further questions or concerns! Best regards, |
Hello,
I'm using the tagging chain from the createTaggingChainFromZod method, to extract the intent and some other data form the user input, and it works pretty well, but sometimes, randomly, I get the following error during the execution:
As I said it does not happen all the times, I tried to understand what causes it, but seems totally random.
I've also tried to understand the error, and it seems that no OpenAI function is passed, but I saw in the code that the function is directly added by the chain, so not sure how this could happen.
The text was updated successfully, but these errors were encountered: