ArchFC endpoint integration (#94)

* integration

* mopdify docker file

* add params and fix python lint

* fix empty context and tool calls

* address comments

* revert port

* fix bug merge

* fix environment

* fix bug

* fix compose

* fix merge
This commit is contained in:
Co Tran 2024-10-01 12:47:26 -07:00 committed by GitHub
parent 1a7c1ad0a5
commit 17a643c410
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 98 additions and 41 deletions

View file

@ -473,7 +473,9 @@ impl StreamContext {
let model_resp = &arch_fc_response.choices[0];
if model_resp.message.tool_calls.is_none() {
if model_resp.message.tool_calls.is_none()
|| model_resp.message.tool_calls.as_ref().unwrap().is_empty()
{
// This means that Arch FC did not have enough information to resolve the function call
// Arch FC probably responded with a message asking for more information.
// Let's send the response back to the user to initalize lightweight dialog for parameter collection
@ -488,12 +490,6 @@ impl StreamContext {
}
let tool_calls = model_resp.message.tool_calls.as_ref().unwrap();
if tool_calls.is_empty() {
return self.send_server_error(
"No tool calls found in function resolver response".to_string(),
Some(StatusCode::BAD_REQUEST),
);
}
debug!("tool_call_details: {:?}", tool_calls);
// extract all tool names