Memory with Function Call

I intend to use memory along with function call.

However it results in an error stating function-call extra fields are not alowed in llmchain.

conversation = LLMChain(
llm=llm,
prompt=prompt,
functions=functions,
temperature=0.0,
verbose=True,
memory=memory )

ValidationError: 3 validation errors for LLMChain function_call extra fields not permitted (type=value_error.extra) functions extra fields not permitted (type=value_error.extra) temperature extra fields not permitted (type=value_error.extra)

Any help would be highly appreciated.

Thanks
Vj

That library looks old, and looks like it access a completion model without support of functions.

There is no “prompt”, the replacement is called “messages”

You’ve got to see whether that LLMChain supports gpt-3.5-turbo model, and whether it handles the extra parameters correctly and would do the iteration on function calls required. And then there must actually be function handlers.

If you aren’t already into the code at the point where you are catching function_call and writing the API function for it, you are likely using the wrong library or have wrong assumptions about it.

Even with the latest lib I get the same error when I try to include function_call.
Conversation = ConversationChain(
llm=llm,
prompt=ENTITY_MEMORY_CONVERSATION_TEMPLATE,
memory=st.session_state.entity_memory
)

ValidationError: 3 validation errors for LLMChain function_call extra fields not permitted (type=value_error.extra) functions extra fields not permitted (type=value_error.extra) temperature extra fields not permitted (type=value_error.extra). Kindly suggest if I am missing something here.

It seems you are using langchain. Have you even done the prerequisites of using gpt-3.5-turbo as a chatbot with the library using the openai.chat methods?

If you are very familiar with langchain and not just pasting code of some online guide, here is documentation of how to use OpenAI function calls in langchain:

It may be more efficient to write your own code than trying to follow someone else’s spaghetti that was not made for the outcome you want.