Skip to content
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

feat(python backend): function call upgrade #368

Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
26077b8
add function_call.py
EliwiiKeeya Jul 28, 2024
2e6bc03
feat(backend): add wip annotation
EliwiiKeeya Jul 29, 2024
f287e32
feat(backend): Synchronized Files
EliwiiKeeya Jul 30, 2024
542a9eb
feat(Backend): detect function call request
EliwiiKeeya Jul 30, 2024
478151a
fix(Backend): detect function call request
EliwiiKeeya Jul 30, 2024
372b433
feat(Backend): Implement function call in non-stream mode for chatmode
EliwiiKeeya Jul 31, 2024
9cbef91
fix(Backend): Fix OpenAI API data format compatibility
EliwiiKeeya Jul 31, 2024
c9e9d51
feat(Backend): Implement non-streaming function call process
EliwiiKeeya Jul 31, 2024
19e9d9f
fix(Backend): Move directory structure from routes to backend-python
EliwiiKeeya Aug 1, 2024
432644d
fix(Backend): Update Prompts to Mobius example and refactor code stru…
EliwiiKeeya Aug 2, 2024
b3994a3
test(Backend): Add postprocss_response.py for tests
EliwiiKeeya Aug 2, 2024
0d06082
fix(Backend): Fix OpenAI API data format compatibility
EliwiiKeeya Aug 2, 2024
6dfc9ec
perf(Backend): Modify some attributes.
EliwiiKeeya Aug 2, 2024
ff5c44f
fix(Backend): Fix postprocess_response funciton.
EliwiiKeeya Aug 3, 2024
0345073
refactor(Backend): Refactor two places related to prompt word synthesis.
EliwiiKeeya Aug 3, 2024
eb89837
修正一些小细节使function_call工作正常
josStorer Aug 8, 2024
8c93173
test(Backend): Add function_call_stream.py
EliwiiKeeya Aug 8, 2024
9747edf
chore(Backend): Add a function to generate streaming responses for to…
EliwiiKeeya Aug 9, 2024
4917205
fix(Backend): Adjust the output format of the streaming test file.
EliwiiKeeya Aug 9, 2024
c4b9c4e
feat(Backend): Try to implement streaming function calls
EliwiiKeeya Aug 9, 2024
6b0f597
style(Backend): Change some format
EliwiiKeeya Aug 9, 2024
3df4302
stream function call细节调整
josStorer Aug 14, 2024
e88ee50
docs(Backend): Modify comments in the code.
EliwiiKeeya Aug 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
perf(Backend): Modify some attributes.
Remove a data check field because it was already validated when it was passed in.
Fix attribute name "logprobs".

Details:
Modify file(s): completion.py
  • Loading branch information
EliwiiKeeya committed Aug 2, 2024
commit 6dfc9ec168656cc792767aad86cd91d931bf3c1c
6 changes: 1 addition & 5 deletions backend-python/routes/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,6 @@ async def chat_with_tools(
system = "System" if body.system_name is None else body.system_name
interface = model.interface
tools_text = str((await request.json())["tools"])
# TODO: check whether input checking is needed
if tools_text == "[]":
raise HTTPException(status.HTTP_400_BAD_REQUEST, "unecepted tools input")

# Function Call Prompts
tools_text = \
Expand Down Expand Up @@ -461,10 +458,9 @@ def postprocess_response(response: dict):
}
)

# TODO check whether analysis one choice only
response["choices"][0]["message"]["tool_calls"] = tool_calls
response["choices"][0]["message"]["content"] = None
response["choices"][0]["lgprobs"] = None
response["choices"][0]["logprobs"] = None
response["choices"][0]["finish_reason"] = "tool_calls"

return response
Expand Down