Skip to content

Commit 4218f7c

Browse files
committed
Release version 0.17.8
1 parent ce17903 commit 4218f7c

File tree

56 files changed

+285
-259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+285
-259
lines changed

config/debug.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
return [
34
'http' => [
45
'enabled' => false, // enable/disable debug

config/embed.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
use Cognesy\Polyglot\LLM\Enums\LLMProviderType;
43
use Cognesy\Utils\Env;
54

65
return [
@@ -11,7 +10,7 @@
1110
'defaultConnection' => 'openai',
1211
'connections' => [
1312
'azure' => [
14-
'providerType' => LLMProviderType::Azure->value,
13+
'providerType' => 'azure',
1514
'apiUrl' => 'https://{resourceName}.openai.azure.com/openai/deployments/{deploymentId}',
1615
'apiKey' => Env::get('AZURE_OPENAI_EMBED_API_KEY', ''),
1716
'endpoint' => '/embeddings',
@@ -25,7 +24,7 @@
2524
'maxInputs' => 16,
2625
],
2726
'cohere1' => [
28-
'providerType' => LLMProviderType::CohereV1->value,
27+
'providerType' => 'cohere1',
2928
'apiUrl' => 'https://api.cohere.ai/v1',
3029
'apiKey' => Env::get('COHERE_API_KEY', ''),
3130
'endpoint' => '/embed',
@@ -34,7 +33,7 @@
3433
'maxInputs' => 96,
3534
],
3635
'gemini' => [
37-
'providerType' => LLMProviderType::Gemini->value,
36+
'providerType' => 'gemini',
3837
'apiUrl' => 'https://generativelanguage.googleapis.com/v1beta',
3938
'apiKey' => Env::get('GEMINI_API_KEY', ''),
4039
'endpoint' => '/{model}:batchEmbedContents',
@@ -43,7 +42,7 @@
4342
'maxInputs' => 100, // max 2048 tokens
4443
],
4544
'jina' => [
46-
'providerType' => LLMProviderType::Jina->value,
45+
'providerType' => 'jina',
4746
'apiUrl' => 'https://api.jina.ai/v1',
4847
'apiKey' => Env::get('JINA_API_KEY', ''),
4948
'endpoint' => '/embeddings',
@@ -55,7 +54,7 @@
5554
'maxInputs' => 500, // max 8192 tokens
5655
],
5756
'mistral' => [
58-
'providerType' => LLMProviderType::Mistral->value,
57+
'providerType' => 'mistral',
5958
'apiUrl' => 'https://api.mistral.ai/v1',
6059
'apiKey' => Env::get('MISTRAL_API_KEY', ''),
6160
'endpoint' => '/embeddings',
@@ -64,7 +63,7 @@
6463
'maxInputs' => 512, // max 512 tokens
6564
],
6665
'ollama' => [
67-
'providerType' => LLMProviderType::Ollama->value,
66+
'providerType' => 'ollama',
6867
'apiUrl' => 'http://localhost:11434/v1',
6968
'apiKey' => Env::get('OLLAMA_API_KEY', ''),
7069
'endpoint' => '/embeddings',
@@ -74,7 +73,7 @@
7473
'httpClient' => 'http-ollama',
7574
],
7675
'openai' => [
77-
'providerType' => LLMProviderType::OpenAI->value,
76+
'providerType' => 'openai',
7877
'apiUrl' => 'https://api.openai.com/v1',
7978
'apiKey' => Env::get('OPENAI_API_KEY', ''),
8079
'endpoint' => '/embeddings',

config/llm.php

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
use Cognesy\Polyglot\LLM\Enums\LLMProviderType;
43
use Cognesy\Utils\Env;
54

65
return [
@@ -16,7 +15,7 @@
1615

1716
'connections' => [
1817
'a21' => [
19-
'providerType' => LLMProviderType::A21->value,
18+
'providerType' => 'a21',
2019
'apiUrl' => 'https://api.ai21.com/studio/v1',
2120
'apiKey' => Env::get('A21_API_KEY', ''),
2221
'endpoint' => '/chat/completions',
@@ -26,7 +25,7 @@
2625
'maxOutputLength' => 4096,
2726
],
2827
'anthropic' => [
29-
'providerType' => LLMProviderType::Anthropic->value,
28+
'providerType' => 'anthropic',
3029
'apiUrl' => 'https://api.anthropic.com/v1',
3130
'apiKey' => Env::get('ANTHROPIC_API_KEY', ''),
3231
'endpoint' => '/messages',
@@ -40,7 +39,7 @@
4039
'maxOutputLength' => 8192,
4140
],
4241
'azure' => [
43-
'providerType' => LLMProviderType::Azure->value,
42+
'providerType' => 'azure',
4443
'apiUrl' => 'https://{resourceName}.openai.azure.com/openai/deployments/{deploymentId}',
4544
'apiKey' => Env::get('AZURE_OPENAI_API_KEY', ''),
4645
'endpoint' => '/chat/completions',
@@ -55,7 +54,7 @@
5554
'maxOutputLength' => 16384,
5655
],
5756
'cerebras' => [
58-
'providerType' => LLMProviderType::Cerebras->value,
57+
'providerType' => 'cerebras',
5958
'apiUrl' => 'https://api.cerebras.ai/v1',
6059
'apiKey' => Env::get('CEREBRAS_API_KEY', ''),
6160
'endpoint' => '/chat/completions',
@@ -65,7 +64,7 @@
6564
'maxOutputLength' => 2048,
6665
],
6766
'cohere1' => [
68-
'providerType' => LLMProviderType::CohereV1->value,
67+
'providerType' => 'cohere1',
6968
'apiUrl' => 'https://api.cohere.ai/v1',
7069
'apiKey' => Env::get('COHERE_API_KEY', ''),
7170
'endpoint' => '/chat',
@@ -75,7 +74,7 @@
7574
'maxOutputLength' => 4096,
7675
],
7776
'cohere2' => [
78-
'providerType' => LLMProviderType::CohereV2->value,
77+
'providerType' => 'cohere2',
7978
'apiUrl' => 'https://api.cohere.ai/v2',
8079
'apiKey' => Env::get('COHERE_API_KEY', ''),
8180
'endpoint' => '/chat',
@@ -85,7 +84,7 @@
8584
'maxOutputLength' => 4096,
8685
],
8786
'deepseek' => [
88-
'providerType' => LLMProviderType::DeepSeek->value,
87+
'providerType' => 'deepseek',
8988
'apiUrl' => 'https://api.deepseek.com',
9089
'apiKey' => Env::get('DEEPSEEK_API_KEY', ''),
9190
'endpoint' => '/chat/completions',
@@ -95,7 +94,7 @@
9594
'maxOutputLength' => 8192,
9695
],
9796
'deepseek-r' => [
98-
'providerType' => LLMProviderType::DeepSeek->value,
97+
'providerType' => 'deepseek',
9998
'apiUrl' => 'https://api.deepseek.com',
10099
'apiKey' => Env::get('DEEPSEEK_API_KEY', ''),
101100
'endpoint' => '/chat/completions',
@@ -105,7 +104,7 @@
105104
'maxOutputLength' => 8192,
106105
],
107106
'fireworks' => [
108-
'providerType' => LLMProviderType::Fireworks->value,
107+
'providerType' => 'fireworks',
109108
'apiUrl' => 'https://api.fireworks.ai/inference/v1',
110109
'apiKey' => Env::get('FIREWORKS_API_KEY', ''),
111110
'endpoint' => '/chat/completions',
@@ -115,7 +114,7 @@
115114
'maxOutputLength' => 4096,
116115
],
117116
'gemini' => [
118-
'providerType' => LLMProviderType::Gemini->value,
117+
'providerType' => 'gemini',
119118
'apiUrl' => 'https://generativelanguage.googleapis.com/v1beta',
120119
'apiKey' => Env::get('GEMINI_API_KEY', ''),
121120
'endpoint' => '/models/{model}:generateContent',
@@ -125,7 +124,7 @@
125124
'maxOutputLength' => 8192,
126125
],
127126
'gemini-oai' => [
128-
'providerType' => LLMProviderType::GeminiOAI->value,
127+
'providerType' => 'gemini-oai',
129128
'apiUrl' => 'https://generativelanguage.googleapis.com/v1beta/openai',
130129
'apiKey' => Env::get('GEMINI_API_KEY', ''),
131130
'endpoint' => '/chat/completions',
@@ -135,7 +134,7 @@
135134
'maxOutputLength' => 8192,
136135
],
137136
'groq' => [
138-
'providerType' => LLMProviderType::Groq->value,
137+
'providerType' => 'groq',
139138
'apiUrl' => 'https://api.groq.com/openai/v1',
140139
'apiKey' => Env::get('GROQ_API_KEY', ''),
141140
'endpoint' => '/chat/completions',
@@ -145,7 +144,7 @@
145144
'maxOutputLength' => 2048,
146145
],
147146
'minimaxi' => [
148-
'providerType' => LLMProviderType::Minimaxi->value,
147+
'providerType' => 'minimaxi',
149148
'apiUrl' => 'https://api.minimaxi.chat/v1',
150149
'apiKey' => Env::get('MINIMAXI_API_KEY', ''),
151150
'endpoint' => '/text/chatcompletion_v2',
@@ -155,7 +154,7 @@
155154
'maxOutputLength' => 4096,
156155
],
157156
'mistral' => [
158-
'providerType' => LLMProviderType::Mistral->value,
157+
'providerType' => 'mistral',
159158
'apiUrl' => 'https://api.mistral.ai/v1',
160159
'apiKey' => Env::get('MISTRAL_API_KEY', ''),
161160
'endpoint' => '/chat/completions',
@@ -165,7 +164,7 @@
165164
'maxOutputLength' => 4096,
166165
],
167166
'moonshot-kimi' => [
168-
'providerType' => LLMProviderType::Moonshot->value,
167+
'providerType' => 'moonshot',
169168
'apiUrl' => 'https://api.moonshot.cn/v1',
170169
'apiKey' => Env::get('MOONSHOT_API_KEY', ''),
171170
'endpoint' => '/chat/completions',
@@ -175,7 +174,7 @@
175174
'maxOutputLength' => 4096,
176175
],
177176
'ollama' => [
178-
'providerType' => LLMProviderType::Ollama->value,
177+
'providerType' => 'ollama',
179178
'apiUrl' => 'http://localhost:11434/v1',
180179
'apiKey' => Env::get('OLLAMA_API_KEY', ''),
181180
'endpoint' => '/chat/completions',
@@ -186,7 +185,7 @@
186185
'maxOutputLength' => 8192,
187186
],
188187
'openai' => [
189-
'providerType' => LLMProviderType::OpenAI->value,
188+
'providerType' => 'openai',
190189
'apiUrl' => 'https://api.openai.com/v1',
191190
'apiKey' => Env::get('OPENAI_API_KEY', ''),
192191
'endpoint' => '/chat/completions',
@@ -200,7 +199,7 @@
200199
'maxOutputLength' => 16384,
201200
],
202201
'openrouter' => [
203-
'providerType' => LLMProviderType::OpenRouter->value,
202+
'providerType' => 'openrouter',
204203
'apiUrl' => 'https://openrouter.ai/api/v1',
205204
'apiKey' => Env::get('OPENROUTER_API_KEY', ''),
206205
'endpoint' => '/chat/completions',
@@ -210,7 +209,7 @@
210209
'maxOutputLength' => 8192,
211210
],
212211
'perplexity' => [
213-
'providerType' => LLMProviderType::Perplexity->value,
212+
'providerType' => 'perplexity',
214213
'apiUrl' => 'https://api.perplexity.ai',
215214
'apiKey' => Env::get('PERPLEXITY_API_KEY', ''),
216215
'endpoint' => '/chat/completions',
@@ -220,7 +219,7 @@
220219
'maxOutputLength' => 2048,
221220
],
222221
'sambanova' => [
223-
'providerType' => LLMProviderType::SambaNova->value,
222+
'providerType' => 'sambanova',
224223
'apiUrl' => 'https://api.sambanova.ai/v1',
225224
'apiKey' => Env::get('SAMBANOVA_API_KEY', ''),
226225
'endpoint' => '/chat/completions',
@@ -230,7 +229,7 @@
230229
'maxOutputLength' => 2048,
231230
],
232231
'together' => [
233-
'providerType' => LLMProviderType::Together->value,
232+
'providerType' => 'together',
234233
'apiUrl' => 'https://api.together.xyz/v1',
235234
'apiKey' => Env::get('TOGETHER_API_KEY', ''),
236235
'endpoint' => '/chat/completions',
@@ -240,7 +239,7 @@
240239
'maxOutputLength' => 4096,
241240
],
242241
'xai' => [
243-
'providerType' => LLMProviderType::XAi->value,
242+
'providerType' => 'xai',
244243
'apiUrl' => 'https://api.x.ai/v1',
245244
'apiKey' => Env::get('XAI_API_KEY', ''),
246245
'endpoint' => '/chat/completions',

config/prompt.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
return [
34
'defaultLibrary' => 'demo-twig',
45

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- (http) Replaced enums with strings in config files - config/http.conf
2+
- (polyglot) Replaced enums with strings in config files - config/embeddings.php, config/llm.php

docs/release-notes/v0.17.8.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- (http) Replaced enums with strings in config files - config/http.conf
2+
- (polyglot) Replaced enums with strings in config files - config/embeddings.php, config/llm.php

packages/addons/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cognesy/instructor-addons",
3-
"version": "0.17.7",
3+
"version": "0.17.8",
44
"description": "Optional addons for Instructor library, should be used with Instructor or Polyglot",
55
"license": "MIT",
66
"homepage": "https://instructorphp.com",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- (http) Replaced enums with strings in config files - config/http.conf
2+
- (polyglot) Replaced enums with strings in config files - config/embeddings.php, config/llm.php

packages/auxiliary/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cognesy/instructor-auxiliary",
3-
"version": "0.17.7",
3+
"version": "0.17.8",
44
"description": "Collection of auxiliary services and integrations",
55
"license": "MIT",
66
"homepage": "https://instructorphp.com",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- (http) Replaced enums with strings in config files - config/http.conf
2+
- (polyglot) Replaced enums with strings in config files - config/embeddings.php, config/llm.php

0 commit comments

Comments
 (0)