mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-12 22:31:24 +00:00
chore: remove You.com support
This commit is contained in:
parent
7fe101ff16
commit
786abd0b31
42 changed files with 3 additions and 1169 deletions
|
|
@ -1,6 +1,5 @@
|
|||
package ee.carlrobert.codegpt.completions
|
||||
|
||||
import ee.carlrobert.codegpt.CodeGPTPlugin
|
||||
import ee.carlrobert.codegpt.completions.llama.PromptTemplate.LLAMA
|
||||
import ee.carlrobert.codegpt.conversations.ConversationService
|
||||
import ee.carlrobert.codegpt.conversations.message.Message
|
||||
|
|
@ -8,12 +7,7 @@ import ee.carlrobert.codegpt.settings.configuration.ConfigurationSettings
|
|||
import ee.carlrobert.llm.client.http.RequestEntity
|
||||
import ee.carlrobert.llm.client.http.exchange.NdJsonStreamHttpExchange
|
||||
import ee.carlrobert.llm.client.http.exchange.StreamHttpExchange
|
||||
import ee.carlrobert.llm.client.ollama.OllamaClient
|
||||
import ee.carlrobert.llm.client.ollama.completion.request.OllamaCompletionRequest
|
||||
import ee.carlrobert.llm.client.ollama.completion.request.OllamaParameters
|
||||
import ee.carlrobert.llm.client.util.JSONUtil.*
|
||||
import ee.carlrobert.llm.completion.CompletionEventListener
|
||||
import okhttp3.sse.EventSource
|
||||
import org.apache.http.HttpHeaders
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import testsupport.IntegrationTest
|
||||
|
|
@ -88,57 +82,6 @@ class DefaultCompletionRequestHandlerTest : IntegrationTest() {
|
|||
waitExpecting { "Hello!" == message.response }
|
||||
}
|
||||
|
||||
fun testYouChatCompletionCall() {
|
||||
useYouService()
|
||||
val message = Message("TEST_PROMPT")
|
||||
val conversation = ConversationService.getInstance().startConversation()
|
||||
conversation.addMessage(Message("Ping", "Pong"))
|
||||
val requestHandler = CompletionRequestHandler(getRequestEventListener(message))
|
||||
expectYou(StreamHttpExchange { request: RequestEntity ->
|
||||
assertThat(request.uri.path).isEqualTo("/api/streamingSearch")
|
||||
assertThat(request.method).isEqualTo("GET")
|
||||
assertThat(request.uri.path).isEqualTo("/api/streamingSearch")
|
||||
assertThat(request.uri.query).isEqualTo(
|
||||
"q=TEST_PROMPT&"
|
||||
+ "page=1&"
|
||||
+ "cfr=CodeGPT&"
|
||||
+ "count=10&"
|
||||
+ "safeSearch=WebPages,Translations,TimeZone,Computation,RelatedSearches&"
|
||||
+ "domain=youchat&"
|
||||
+ "selectedChatMode=default&"
|
||||
+ "chat=[{\"question\":\"Ping\",\"answer\":\"Pong\"}]&"
|
||||
+ "utm_source=ide&"
|
||||
+ "utm_medium=jetbrains&"
|
||||
+ "utm_campaign=" + CodeGPTPlugin.getVersion() + "&"
|
||||
+ "utm_content=CodeGPT")
|
||||
assertThat(request.headers)
|
||||
.flatExtracting("Accept", "Connection", "User-agent", "Cookie")
|
||||
.containsExactly(
|
||||
"text/event-stream",
|
||||
"Keep-Alive",
|
||||
"youide CodeGPT",
|
||||
"safesearch_guest=Moderate; "
|
||||
+ "youpro_subscription=true; "
|
||||
+ "you_subscription=free; "
|
||||
+ "stytch_session=; "
|
||||
+ "ydc_stytch_session=; "
|
||||
+ "stytch_session_jwt=; "
|
||||
+ "ydc_stytch_session_jwt=; "
|
||||
+ "eg4=false; "
|
||||
+ "__cf_bm=aN2b3pQMH8XADeMB7bg9s1bJ_bfXBcCHophfOGRg6g0-1693601599-0-"
|
||||
+ "AWIt5Mr4Y3xQI4mIJ1lSf4+vijWKDobrty8OopDeBxY+NABe0MRFidF3dCUoWjRt8"
|
||||
+ "SVMvBZPI3zkOgcRs7Mz3yazd7f7c58HwW5Xg9jdBjNg;")
|
||||
listOf(
|
||||
jsonMapResponse("youChatToken", "Hel"),
|
||||
jsonMapResponse("youChatToken", "lo"),
|
||||
jsonMapResponse("youChatToken", "!"))
|
||||
})
|
||||
|
||||
requestHandler.call(CallParameters(conversation, ConversationType.DEFAULT, message, false))
|
||||
|
||||
waitExpecting { "Hello!" == message.response }
|
||||
}
|
||||
|
||||
fun testLlamaChatCompletionCall() {
|
||||
useLlamaService()
|
||||
ConfigurationSettings.getCurrentState().maxTokens = 99
|
||||
|
|
|
|||
|
|
@ -47,17 +47,6 @@ class GeneralSettingsTest : BasePlatformTestCase() {
|
|||
assertThat(settings.state.selectedService).isEqualTo(ServiceType.AZURE)
|
||||
}
|
||||
|
||||
fun testYouSettingsSync() {
|
||||
val settings = GeneralSettings.getInstance()
|
||||
val conversation = Conversation()
|
||||
conversation.model = "YouCode"
|
||||
conversation.clientCode = "you.chat.completion"
|
||||
|
||||
settings.sync(conversation)
|
||||
|
||||
assertThat(settings.state.selectedService).isEqualTo(ServiceType.YOU)
|
||||
}
|
||||
|
||||
fun testLlamaSettingsModelPathSync() {
|
||||
val llamaSettings = LlamaSettings.getCurrentState()
|
||||
llamaSettings.huggingFaceModel = HuggingFaceModel.WIZARD_CODER_PYTHON_7B_Q3
|
||||
|
|
|
|||
|
|
@ -43,10 +43,6 @@ interface ShortcutsTestMixin {
|
|||
azureSettings.deploymentId = "TEST_DEPLOYMENT_ID"
|
||||
}
|
||||
|
||||
fun useYouService() {
|
||||
GeneralSettings.getCurrentState().selectedService = ServiceType.YOU
|
||||
}
|
||||
|
||||
fun useLlamaService(codeCompletionsEnabled: Boolean = false) {
|
||||
GeneralSettings.getCurrentState().selectedService = ServiceType.LLAMA_CPP
|
||||
LlamaSettings.getCurrentState().serverPort = null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue