mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 01:24:36 +00:00
try fix owui
This commit is contained in:
parent
0ed95fcccc
commit
12e5b8abdb
1 changed files with 1 additions and 3 deletions
|
@ -3206,10 +3206,8 @@ Enter Prompt:<br>
|
||||||
toolsdata_res[0]["index"] = 0 # need to add an index for OWUI
|
toolsdata_res[0]["index"] = 0 # need to add an index for OWUI
|
||||||
except Exception:
|
except Exception:
|
||||||
toolsdata_res = []
|
toolsdata_res = []
|
||||||
toolsdata_p1 = json.dumps({"id":"koboldcpp","object":"chat.completion.chunk","created":int(time.time()),"model":friendlymodelname,"choices":[{"index":0,"finish_reason":None,"delta":{'role':'assistant','content':None, "tool_calls":toolsdata_res}}]})
|
toolsdata_p1 = json.dumps({"id":"koboldcpp","object":"chat.completion.chunk","created":int(time.time()),"model":friendlymodelname,"choices":[{"index":0,"finish_reason":"tool_calls","delta":{'role':'assistant','content':None, "tool_calls":toolsdata_res}}]})
|
||||||
toolsdata_p2 = json.dumps({"id":"koboldcpp","object":"chat.completion.chunk","created":int(time.time()),"model":friendlymodelname,"choices":[{"index":0,"finish_reason":"tool_calls","delta":{}}]})
|
|
||||||
self.wfile.write(f'data: {toolsdata_p1}\n\n'.encode())
|
self.wfile.write(f'data: {toolsdata_p1}\n\n'.encode())
|
||||||
self.wfile.write(f'data: {toolsdata_p2}\n\n'.encode())
|
|
||||||
self.wfile.write('data: [DONE]'.encode())
|
self.wfile.write('data: [DONE]'.encode())
|
||||||
self.wfile.flush()
|
self.wfile.flush()
|
||||||
self.close_connection = True
|
self.close_connection = True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue