|
6 | 6 | use PhpLlm\LlmChain\DocumentEmbedder; |
7 | 7 | use PhpLlm\LlmChain\Message\Message; |
8 | 8 | use PhpLlm\LlmChain\Message\MessageBag; |
9 | | -use PhpLlm\LlmChain\OpenAI\Model\Embeddings; |
10 | | -use PhpLlm\LlmChain\OpenAI\Model\Gpt; |
11 | | -use PhpLlm\LlmChain\OpenAI\Model\Gpt\Version; |
12 | | -use PhpLlm\LlmChain\OpenAI\Platform\OpenAI; |
| 9 | +use PhpLlm\LlmChain\Model\Embeddings\OpenAI as Embeddings; |
| 10 | +use PhpLlm\LlmChain\Model\Language\Gpt; |
| 11 | +use PhpLlm\LlmChain\Platform\OpenAI\OpenAI as Platform; |
13 | 12 | use PhpLlm\LlmChain\Store\Pinecone\Store; |
14 | 13 | use PhpLlm\LlmChain\ToolBox\ChainProcessor; |
15 | 14 | use PhpLlm\LlmChain\ToolBox\Tool\SimilaritySearch; |
|
48 | 47 | } |
49 | 48 |
|
50 | 49 | // create embeddings for documents |
51 | | -$platform = new OpenAI(HttpClient::create(), $_ENV['OPENAI_API_KEY']); |
| 50 | +$platform = new Platform(HttpClient::create(), $_ENV['OPENAI_API_KEY']); |
52 | 51 | $embedder = new DocumentEmbedder($embeddings = new Embeddings($platform), $store); |
53 | 52 | $embedder->embed($documents); |
54 | 53 |
|
55 | | -$llm = new Gpt($platform, Version::gpt4oMini()); |
| 54 | +$llm = new Gpt($platform, Gpt::GPT_4O_MINI); |
56 | 55 |
|
57 | 56 | $similaritySearch = new SimilaritySearch($embeddings, $store); |
58 | 57 | $toolBox = new ToolBox(new ToolAnalyzer(), [$similaritySearch]); |
|
0 commit comments