fix api key test case
This commit is contained in:
parent
d2e1411ca9
commit
c15f5a6e1b
2 changed files with 2 additions and 3 deletions
|
@ -3349,8 +3349,7 @@ int main(int argc, char ** argv) {
|
||||||
std::string content = body["content"];
|
std::string content = body["content"];
|
||||||
prompts.push_back(content);
|
prompts.push_back(content);
|
||||||
} else {
|
} else {
|
||||||
// TODO @ngxson : should return an error here
|
res_error(res, format_error_response("\"input\" or \"content\" must be provided", ERROR_INVALID_REQUEST));
|
||||||
prompts.push_back("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// process all prompts
|
// process all prompts
|
||||||
|
|
|
@ -800,7 +800,7 @@ async def oai_chat_completions(user_prompt,
|
||||||
stream=enable_streaming,
|
stream=enable_streaming,
|
||||||
seed=seed
|
seed=seed
|
||||||
)
|
)
|
||||||
except openai.error.APIError as e:
|
except openai.error.AuthenticationError as e:
|
||||||
if expect_api_error is not None and expect_api_error:
|
if expect_api_error is not None and expect_api_error:
|
||||||
return 401
|
return 401
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue