diff --git a/src/CCatClient.php b/src/CCatClient.php index fc6d012..1e723a9 100644 --- a/src/CCatClient.php +++ b/src/CCatClient.php @@ -277,6 +277,29 @@ public function putLLMSettings(string $llm, array $values): LLMSettingsOutput return $this->serializer->deserialize($response->getBody()->getContents(), LLMSettingsOutput::class, 'json', []); } + /** + * @param string $embedder + * @param array $values + * @return LLMSettingsOutput + */ + public function putEmbedderSettings(string $embedder, array $values): LLMSettingsOutput + { + $response = $this->httpClient->getHttpClient()->put(sprintf('/embedder/settings/%s', $embedder), [ + 'json' => $values + ]); + return $this->serializer->deserialize($response->getBody()->getContents(), LLMSettingsOutput::class, 'json', []); + } + + /** + * @param string $embedder + * @return LLMSettingsOutput + */ + public function getEmbedderSettings(string $embedder): LLMSettingsOutput + { + $response = $this->httpClient->getHttpClient()->get(sprintf('/embedder/settings/%s', $embedder)); + return $this->serializer->deserialize($response->getBody()->getContents(), LLMSettingsOutput::class, 'json', []); + } + /** * @param string $pluginId * @param array $values diff --git a/src/index.php b/src/index.php index 8827c50..64f755b 100644 --- a/src/index.php +++ b/src/index.php @@ -1,6 +1,6 @@ putLLMSettings("LLMOpenAIChatConfig", [ -// "open_api_key" => "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", -// "temperature" => 0.7, -// "model_name" => "gpt-3.5-turbo", -// "streaming" => true, -// ]); +// $response = $cCatClient->getEmbedderSettings("EmbedderOpenAIConfig"); // // // // "prompt_prefix" => "You are a supportive AI that help during hard time" , // // "episodic_memory_k" => 3, @@ -37,5 +32,5 @@ //} catch (Exception $exception) { // var_dump($exception->getMessage()); //} -////$response = $cCatClient->sendMessage(new \Albocode\CcatphpSdk\Model\Message("Ciao come stai?", "test"), fn($message) => var_dump($message)); -////var_dump($response); +//$response = $cCatClient->sendMessage(new \Albocode\CcatphpSdk\Model\Message("Ciao come stai?", "test"), fn($message) => var_dump($message)); +//var_dump($response);