intitni / CustomSuggestionServiceForCopilotForXcode

Use locally run models (OpenAI compatible APIs, Tabby, Ollama) to generate code suggestions for Xcode.
MIT License
40 stars 6 forks source link

DeepSeek FIM support #15

Closed ivoidcat closed 1 month ago

ivoidcat commented 1 month ago

你好,我用这个扩展很久了,非常好用。感谢作者的付出! 最近一直在使用deepseek来代替chatgpt,因为接口很便宜,而且速度可以快,编码质量也很棒,我看他现在出了一个FIM 补全,不知能否加到本扩展中 https://platform.deepseek.com/api-docs/zh-cn/guides/fim_completion

看起来它的 API 和 FIM model - Mistral 的格式很像,你可以试一试能不能直接用 你好,作者,这个我试过了,似乎不行,如果需要测试我可以提供key

ivoidcat commented 1 month ago

具体来说,会响应404 Task .<159> summary for task success {transaction_duration_ms=64, response_status=404, connection=11, reused=1, reused_after_ms=1598, request_start_ms=1, request_duration_ms=10, response_start_ms=62, response_duration_ms=1, request_bytes=691, response_bytes=174, cache_hit=false}

image

baseurl 与 full url都是一样的。

使用custom model(completion api)是可以的,也就是会说只有FIM不行

intitni commented 1 month ago

麻烦试试选 full url,然后 url 填写 https://api.deepseek.com/beta/completions

ivoidcat commented 1 month ago

默认 14:53:39.200495+0800 Custom Suggestion Service order window front conditionally: 8e7 related: 0 默认 14:53:39.210351+0800 Custom Suggestion Service Gained inheritances: {( <RBSInheritance| environment:(none) name:com.apple.launchservices.userfacing origID:171-132-27543 0>, <RBSInheritance| environment:(none) name:com.apple.launchservices.userfacing origID:171-132-27543 0> )} 默认 14:53:39.214251+0800 Custom Suggestion Service Gained inheritances: {( <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:171-157-27544 0> )} 默认 14:53:39.235507+0800 Custom Suggestion Service [0x600000930d20] activating connection: mach=false listener=false peer=false name=com.apple.TextInputUI.xpc.CursorUIViewService 默认 14:53:39.237257+0800 Custom Suggestion Service [0x107d2ac60] activating connection: mach=false listener=false peer=false name=(anonymous) 默认 14:53:39.237322+0800 Custom Suggestion Service [0x12de1a6f0] activating connection: mach=false listener=false peer=false name=(anonymous) 默认 14:53:39.237447+0800 Custom Suggestion Service [0x600000930d20] invalidated after the last release of the connection object 默认 14:53:39.265218+0800 Custom Suggestion Service -[TUINSCursorUIController activate:]_block_invoke: Create CursorUIViewService: TUINSRemoteViewController 默认 14:53:39.265444+0800 Custom Suggestion Service [0x12fb23670] invalidated because the current process cancelled the connection by calling xpc_connection_cancel() 默认 14:53:39.265463+0800 Custom Suggestion Service [0x12fa15760] invalidated because the current process cancelled the connection by calling xpc_connection_cancel() 故障 14:53:39.265491+0800 Custom Suggestion Service CLIENT ERROR: TUINSRemoteViewController does not override - and thus cannot react to catastrophic errors beyond logging them 默认 14:53:41.389880+0800 Custom Suggestion Service Task .<57> resuming, timeouts(60.0, 604800.0) QOS(0x19) Voucher (null) 默认 14:53:41.391923+0800 Custom Suggestion Service [C2] event: client:connection_reused @62.598s 默认 14:53:41.392318+0800 Custom Suggestion Service Task .<57> now using Connection 2 默认 14:53:41.393321+0800 Custom Suggestion Service Task .<57> sent request, body S 189 默认 14:53:41.993613+0800 Custom Suggestion Service Task .<57> received response, status 200 content U 默认 14:53:42.092879+0800 Custom Suggestion Service Task .<57> summary for task failure {transaction_duration_ms=702, response_status=200, connection=2, reused=1, reused_after_ms=36292, request_start_ms=1, request_duration_ms=0, response_start_ms=602, response_duration_ms=0, request_bytes=270, response_bytes=775, cache_hit=true} 默认 14:53:42.092928+0800 Custom Suggestion Service Task .<57> finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 UserInfo={NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, _NSURLErrorRelatedURLSessionTaskErrorKey=, _NSURLErrorFailingURLSessionTaskErrorKey=, NSLocalizedDescription=} 默认 14:53:42.093390+0800 Custom Suggestion Service Task .<57> done using Connection 2 默认 14:53:42.111289+0800 Custom Suggestion Service [C2] event: client:connection_idle @63.318s 默认 14:53:42.531585+0800 Custom Suggestion Service Task <8FEC597D-55CA-4FF7-A87B-712B6ECFB7F9>.<58> resuming, timeouts(60.0, 604800.0) QOS(0x19) Voucher (null) 默认 14:53:42.532228+0800 Custom Suggestion Service [C2] event: client:connection_reused @63.739s 默认 14:53:42.532421+0800 Custom Suggestion Service Task <8FEC597D-55CA-4FF7-A87B-712B6ECFB7F9>.<58> now using Connection 2 默认 14:53:42.532700+0800 Custom Suggestion Service Task <8FEC597D-55CA-4FF7-A87B-712B6ECFB7F9>.<58> sent request, body S 189 默认 14:53:42.890058+0800 Custom Suggestion Service Task <8FEC597D-55CA-4FF7-A87B-712B6ECFB7F9>.<58> received response, status 200 content U 默认 14:53:44.750998+0800 Custom Suggestion Service Task <8FEC597D-55CA-4FF7-A87B-712B6ECFB7F9>.<58> done using Connection 2 默认 14:53:44.751524+0800 Custom Suggestion Service [C2] event: client:connection_idle @65.958s 默认 14:53:44.752281+0800 Custom Suggestion Service Task <8FEC597D-55CA-4FF7-A87B-712B6ECFB7F9>.<58> response ended 默认 14:53:44.753276+0800 Custom Suggestion Service Task <8FEC597D-55CA-4FF7-A87B-712B6ECFB7F9>.<58> summary for task failure {transaction_duration_ms=2221, response_status=200, connection=2, reused=1, reused_after_ms=413, request_start_ms=0, request_duration_ms=0, response_start_ms=358, response_duration_ms=0, request_bytes=270, response_bytes=8045, cache_hit=true} 默认 14:53:44.753884+0800 Custom Suggestion Service Task <8FEC597D-55CA-4FF7-A87B-712B6ECFB7F9>.<58> finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 UserInfo={NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, _NSURLErrorRelatedURLSessionTaskErrorKey=, _NSURLErrorFailingURLSessionTaskErrorKey=, NSLocalizedDescription=} 默认 14:54:03.014363+0800 Custom Suggestion Service order window front conditionally: 8e7 related: 0 默认 14:54:03.018471+0800 Custom Suggestion Service Gained inheritances: {( <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:171-157-27573 0> )} 默认 14:54:03.024857+0800 Custom Suggestion Service Gained inheritances: {( <RBSInheritance| environment:(none) name:com.apple.launchservices.userfacing origID:171-132-27574 0>, <RBSInheritance| environment:(none) name:com.apple.launchservices.userfacing origID:171-132-27574 0> )} 默认 14:54:03.076880+0800 Custom Suggestion Service [0x60000093d2c0] activating connection: mach=false listener=false peer=false name=com.apple.TextInputUI.xpc.CursorUIViewService 默认 14:54:03.096214+0800 Custom Suggestion Service [0x60000093d2c0] invalidated after the last release of the connection object 默认 14:54:03.096312+0800 Custom Suggestion Service [0x12de8e080] activating connection: mach=false listener=false peer=false name=(anonymous) 默认 14:54:03.096358+0800 Custom Suggestion Service [0x12de92e80] activating connection: mach=false listener=false peer=false name=(anonymous) 默认 14:54:03.108342+0800 Custom Suggestion Service -[TUINSCursorUIController activate:]_block_invoke: Create CursorUIViewService: TUINSRemoteViewController 默认 14:54:03.108587+0800 Custom Suggestion Service [0x12de1a6f0] invalidated because the current process cancelled the connection by calling xpc_connection_cancel() 默认 14:54:03.108608+0800 Custom Suggestion Service [0x107d2ac60] invalidated because the current process cancelled the connection by calling xpc_connection_cancel() 故障 14:54:03.108637+0800 Custom Suggestion Service CLIENT ERROR: TUINSRemoteViewController does not override - and thus cannot react to catastrophic errors beyond logging them 默认 14:54:06.772126+0800 Custom Suggestion Service Task <6874D1D0-3CBB-40CF-A818-FFD466A6D5E1>.<59> resuming, timeouts(60.0, 604800.0) QOS(0x19) Voucher (null) 默认 14:54:06.773785+0800 Custom Suggestion Service [C2] event: client:connection_reused @87.980s 默认 14:54:06.774138+0800 Custom Suggestion Service Task <6874D1D0-3CBB-40CF-A818-FFD466A6D5E1>.<59> now using Connection 2 默认 14:54:06.774629+0800 Custom Suggestion Service Task <6874D1D0-3CBB-40CF-A818-FFD466A6D5E1>.<59> sent request, body S 179 默认 14:54:06.917637+0800 Custom Suggestion Service Task <6874D1D0-3CBB-40CF-A818-FFD466A6D5E1>.<59> summary for task failure {transaction_duration_ms=144, response_status=200, connection=2, reused=1, reused_after_ms=22022, request_start_ms=1, request_duration_ms=0, response_start_ms=0, response_duration_ms=0, request_bytes=260, response_bytes=0, cache_hit=true} 默认 14:54:06.917736+0800 Custom Suggestion Service Task <6874D1D0-3CBB-40CF-A818-FFD466A6D5E1>.<59> finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 UserInfo={NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, _NSURLErrorRelatedURLSessionTaskErrorKey=, _NSURLErrorFailingURLSessionTaskErrorKey=, NSLocalizedDescription=} 默认 14:54:06.918103+0800 Custom Suggestion Service Task <6874D1D0-3CBB-40CF-A818-FFD466A6D5E1>.<59> done using Connection 2 默认 14:54:06.918174+0800 Custom Suggestion Service [C2] event: client:connection_idle @88.125s 默认 14:54:07.446611+0800 Custom Suggestion Service Task .<60> resuming, timeouts(60.0, 604800.0) QOS(0x19) Voucher (null) 默认 14:54:07.447926+0800 Custom Suggestion Service [C2] event: client:connection_reused @88.654s 默认 14:54:07.448204+0800 Custom Suggestion Service Task .<60> now using Connection 2 默认 14:54:07.448833+0800 Custom Suggestion Service Task .<60> sent request, body S 183 默认 14:54:07.900381+0800 Custom Suggestion Service Task .<60> received response, status 200 content U 默认 14:54:07.923141+0800 Custom Suggestion Service Task .<60> summary for task failure {transaction_duration_ms=475, response_status=200, connection=2, reused=1, reused_after_ms=529, request_start_ms=1, request_duration_ms=0, response_start_ms=452, response_duration_ms=0, request_bytes=264, response_bytes=772, cache_hit=true} 默认 14:54:07.923247+0800 Custom Suggestion Service Task .<60> finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 UserInfo={NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, _NSURLErrorRelatedURLSessionTaskErrorKey=, _NSURLErrorFailingURLSessionTaskErrorKey=, NSLocalizedDescription=} 默认 14:54:07.923609+0800 Custom Suggestion Service Task .<60> done using Connection 2 默认 14:54:07.923674+0800 Custom Suggestion Service [C2] event: client:connection_idle @89.130s 默认 14:54:09.823070+0800 Custom Suggestion Service Task <20976CC2-A938-4376-8230-30773944E203>.<61> resuming, timeouts(60.0, 604800.0) QOS(0x19) Voucher (null) 默认 14:54:09.824577+0800 Custom Suggestion Service [C2] event: client:connection_reused @91.031s 默认 14:54:09.824944+0800 Custom Suggestion Service Task <20976CC2-A938-4376-8230-30773944E203>.<61> now using Connection 2 默认 14:54:09.825509+0800 Custom Suggestion Service Task <20976CC2-A938-4376-8230-30773944E203>.<61> sent request, body S 183 默认 14:54:10.562300+0800 Custom Suggestion Service Task <20976CC2-A938-4376-8230-30773944E203>.<61> received response, status 200 content U 默认 14:54:11.215554+0800 Custom Suggestion Service Task <20976CC2-A938-4376-8230-30773944E203>.<61> summary for task failure {transaction_duration_ms=1391, response_status=200, connection=2, reused=1, reused_after_ms=1900, request_start_ms=1, request_duration_ms=0, response_start_ms=738, response_duration_ms=0, request_bytes=264, response_bytes=2731, cache_hit=true} 默认 14:54:11.215631+0800 Custom Suggestion Service Task <20976CC2-A938-4376-8230-30773944E203>.<61> finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 UserInfo={NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, _NSURLErrorRelatedURLSessionTaskErrorKey=, _NSURLErrorFailingURLSessionTaskErrorKey=, NSLocalizedDescription=} 默认 14:54:11.215929+0800 Custom Suggestion Service Task <20976CC2-A938-4376-8230-30773944E203>.<61> done using Connection 2 默认 14:54:11.216130+0800 Custom Suggestion Service [C2] event: client:connection_idle @92.423s 默认 14:54:12.604185+0800 Custom Suggestion Service Task <276912E5-7803-4CF0-9D14-67CF45AC0099>.<62> resuming, timeouts(60.0, 604800.0) QOS(0x19) Voucher (null) 默认 14:54:12.612008+0800 Custom Suggestion Service [C2] event: client:connection_reused @93.818s 默认 14:54:12.612303+0800 Custom Suggestion Service Task <276912E5-7803-4CF0-9D14-67CF45AC0099>.<62> now using Connection 2 默认 14:54:12.613337+0800 Custom Suggestion Service Task <276912E5-7803-4CF0-9D14-67CF45AC0099>.<62> sent request, body S 183 默认 14:54:13.211934+0800 Custom Suggestion Service Task <276912E5-7803-4CF0-9D14-67CF45AC0099>.<62> received response, status 200 content U 默认 14:54:13.671437+0800 Custom Suggestion Service Task <276912E5-7803-4CF0-9D14-67CF45AC0099>.<62> done using Connection 2 默认 14:54:13.671698+0800 Custom Suggestion Service [C2] event: client:connection_idle @94.878s 默认 14:54:13.671963+0800 Custom Suggestion Service Task <276912E5-7803-4CF0-9D14-67CF45AC0099>.<62> response ended 默认 14:54:13.672986+0800 Custom Suggestion Service Task <276912E5-7803-4CF0-9D14-67CF45AC0099>.<62> summary for task failure {transaction_duration_ms=1061, response_status=200, connection=2, reused=1, reused_after_ms=1395, request_start_ms=1, request_duration_ms=0, response_start_ms=600, response_duration_ms=460, request_bytes=264, response_bytes=2387, cache_hit=true} 默认 14:54:13.673202+0800 Custom Suggestion Service Task <276912E5-7803-4CF0-9D14-67CF45AC0099>.<62> finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 UserInfo={NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, _NSURLErrorRelatedURLSessionTaskErrorKey=, _NSURLErrorFailingURLSessionTaskErrorKey=, NSLocalizedDescription=} 默认 14:54:15.134159+0800 Custom Suggestion Service Task <47F65284-8002-4BB7-B498-5067B64A0FAF>.<63> resuming, timeouts(60.0, 604800.0) QOS(0x19) Voucher (null) 默认 14:54:15.135194+0800 Custom Suggestion Service [C2] event: client:connection_reused @96.342s 默认 14:54:15.135402+0800 Custom Suggestion Service Task <47F65284-8002-4BB7-B498-5067B64A0FAF>.<63> now using Connection 2 默认 14:54:15.136096+0800 Custom Suggestion Service Task <47F65284-8002-4BB7-B498-5067B64A0FAF>.<63> sent request, body S 183 默认 14:54:15.562082+0800 Custom Suggestion Service Task <47F65284-8002-4BB7-B498-5067B64A0FAF>.<63> received response, status 200 content U 默认 14:54:16.103382+0800 Custom Suggestion Service Task <47F65284-8002-4BB7-B498-5067B64A0FAF>.<63> done using Connection 2 默认 14:54:16.103699+0800 Custom Suggestion Service [C2] event: client:connection_idle @97.310s 默认 14:54:16.104068+0800 Custom Suggestion Service Task <47F65284-8002-4BB7-B498-5067B64A0FAF>.<63> response ended 默认 14:54:16.104933+0800 Custom Suggestion Service Task <47F65284-8002-4BB7-B498-5067B64A0FAF>.<63> summary for task failure {transaction_duration_ms=970, response_status=200, connection=2, reused=1, reused_after_ms=1463, request_start_ms=0, request_duration_ms=0, response_start_ms=427, response_duration_ms=542, request_bytes=264, response_bytes=2396, cache_hit=true} 默认 14:54:16.105098+0800 Custom Suggestion Service Task <47F65284-8002-4BB7-B498-5067B64A0FAF>.<63> finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 UserInfo={NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, _NSURLErrorRelatedURLSessionTaskErrorKey=, _NSURLErrorFailingURLSessionTaskErrorKey=, NSLocalizedDescription=} 似乎不行

ivoidcat commented 1 month ago

除了默认 14:55:24.068356+0800 Custom Suggestion Service Task <668AA56D-63B0-40B8-A768-3B979EFD94AB>.<72> finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 UserInfo={NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, _NSURLErrorRelatedURLSessionTaskErrorKey=, _NSURLErrorFailingURLSessionTaskErrorKey=, NSLocalizedDescription=}

这个,倒是没有404了,但是并没有输入内容,如果您愿意留个联系方式,我会将key提供给您。

intitni commented 1 month ago

他们的鉴权方式不一样,需要另外实现

intitni commented 1 month ago

0.5.0 里 Mistral FIM API 选项能够适配 DeepSeek 的 API 了。因为差异太小了就不弄另外的选项了

ivoidcat commented 1 month ago

牛的,我试下

ivoidcat commented 1 month ago

我试了下,在Custom Suggestion Service是可以用的,但是在xcode里面就没法提示了

intitni commented 1 month ago

重开一下 CopilotForXcodeExtensionService

ivoidcat commented 1 month ago

可以了大佬,我深度体验下,这个提示看看效果怎么样,感谢