You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In calling a prediction endpoint of a chatbot via API, I tried using the overrideConfig method for passing an overrideConfig to two parameters named the same way in two different nodes (in my case openAIEmbeddings and chatOpenAI, both having a modelName parameter), However, the call seems to allow override of all chatflow parameters except the modelName for either of the two nodes. The value of modelName remains fixed to the default, regardless of the values given in overrideConfig. This happens despite the fact that I am specifying the two model names as described in the documentation (in the Embed window of the chatflow web interface):
(I know that the structure of the body_data argument is different in the image snippet, with no "overrideConfig", but I followed the structure of the main documentation. Also, trying to use the format without "overrideConfig" results in none of the parameters being updated)
(I double checked, that seems to be the name of the two nodes, at least according to the export of the chatflow schema)
If I don't specify the node name (i.e. just using one "modelName": ...), the value seems to be read correctly, but then of course one of the two nodes complains about a non-existing model.
The issue seem to be caused by using the "<param_name>[<node_id>]" syntax, since using it for a uniquely named parameter in the chatflow also results in the override value not being used.
To Reproduce
I am calling the API from a python script, following the format suggested in the API documentation:
# ... API url and key were read from .env, overrideConfigs stored in settings dictionaryheaders= {"Authorization": f"Bearer {API_KEY}"}
defquery(body_data) ->Response:
response=requests.post(API_URL, json=body_data, headers=headers)
returnresponsedefmain() ->None:
body_data= {
"question": settings["question"],
"overrideConfig": {
"modelName[openAIEmbeddings_0]": settings["modelName_embeddings"],
"modelName[chatOpenAI_0]": settings["modelName_chat"],
# other params
},
}
output=query(body_data)
The chatflow schema is a simple qna from a text-file document with in-memory store:
Expected behavior
When using an overrideConfig parameter containing the fields "modelName[<node_id>] is expect the value of the modelName parameter to be updated.
Hi Henry, thanks for the suggestion. It still seems like something is off, since I now get this error:
DEBUG:root:b"400 We could not parse the JSON body of your request. (HINT: This likely means you aren't using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)"
(to me it seems like the value of the "modelName" field is still sent all to both of the nodes, leading to OpenAI API complaining that they are getting the wrong format for modelName in the call)
You are right, somehow I must have made a mistake in calling the model name. Sorry about that, trying again with your suggested format worked well. Thanks a lot!
Describe the bug
In calling a prediction endpoint of a chatbot via API, I tried using the overrideConfig method for passing an overrideConfig to two parameters named the same way in two different nodes (in my case openAIEmbeddings and chatOpenAI, both having a modelName parameter), However, the call seems to allow override of all chatflow parameters except the modelName for either of the two nodes. The value of modelName remains fixed to the default, regardless of the values given in overrideConfig. This happens despite the fact that I am specifying the two model names as described in the documentation (in the Embed window of the chatflow web interface):
(I know that the structure of the body_data argument is different in the image snippet, with no "overrideConfig", but I followed the structure of the main documentation. Also, trying to use the format without "overrideConfig" results in none of the parameters being updated)
(I double checked, that seems to be the name of the two nodes, at least according to the export of the chatflow schema)
If I don't specify the node name (i.e. just using one "modelName": ...), the value seems to be read correctly, but then of course one of the two nodes complains about a non-existing model.
The issue seem to be caused by using the "<param_name>[<node_id>]" syntax, since using it for a uniquely named parameter in the chatflow also results in the override value not being used.
To Reproduce
I am calling the API from a python script, following the format suggested in the API documentation:
The chatflow schema is a simple qna from a text-file document with in-memory store:
Expected behavior
When using an overrideConfig parameter containing the fields
"modelName[<node_id>]
is expect the value of the modelName parameter to be updated.Flow
test_overrideConfig_issue Chatflow.json
Setup
The text was updated successfully, but these errors were encountered: