diff --git a/koboldcpp.py b/koboldcpp.py index 1bb150e60..3a6f20f47 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -3476,15 +3476,14 @@ class KcppServerRequestHandler(http.server.SimpleHTTPRequestHandler): async def handle_sse_stream(self, genparams, api_format): global friendlymodelname, currfinishreason - # if tools, do not send anything - OAI tool calls will be handled with fakestreaming! using_openai_tools = genparams.get('using_openai_tools', False) - if api_format == 4 and using_openai_tools: - return self.send_response(200) self.send_header("X-Accel-Buffering", "no") self.send_header("cache-control", "no-cache") self.send_header("connection", "keep-alive") self.end_headers(content_type='text/event-stream') + if api_format == 4 and using_openai_tools: # if tools, do not send anything else - OAI tool calls will be handled with fakestreaming! + return encap_in_thinking = False encap_first_loop = True @@ -4850,12 +4849,6 @@ Change Mode
self.end_headers(content_type='application/json') self.wfile.write(genresp) elif api_format == 4 and genparams.get('using_openai_tools', False): #special case, fake streaming for openai tool calls - self.send_response(200) - self.send_header("X-Accel-Buffering", "no") - self.send_header("cache-control", "no-cache") - self.send_header("connection", "keep-alive") - self.end_headers(content_type='text/event-stream') - content_text = None toolsdata_res = [] try: