Skip to content

Commit c500c7d

Browse files
committed
Better integration with PSR events
1 parent 7c665e2 commit c500c7d

File tree

106 files changed

+533
-482
lines changed

Some content is hidden

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

106 files changed

+533
-482
lines changed

bin/code2md.sh

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,28 @@ for dir in packages/*; do
99
fi
1010
done
1111

12-
code2prompt "packages/utils/src/JsonSchema" -o "tmp/json-schema.md"
13-
code2prompt "packages/utils/src/Messages" -o "tmp/messages.md"
14-
code2prompt "packages/polyglot/src/LLM" -o "tmp/llm.md"
15-
code2prompt "packages/polyglot/src/Embeddings" -o "tmp/embeddings.md"
12+
code2prompt "packages/utils/src/JsonSchema" -o "tmp/util-json-schema.md"
13+
code2prompt "packages/utils/src/Messages" -o "tmp/util-messages.md"
14+
code2prompt "packages/utils/src/Events" -o "tmp/util-events.md"
15+
code2prompt "packages/utils/src/Config" -o "tmp/util-config.md"
16+
code2prompt "packages/polyglot/src/LLM" -o "tmp/poly-llm.md"
17+
code2prompt "packages/polyglot/src/Embeddings" -o "tmp/poly-embeddings.md"
18+
19+
# MAKE POLYGLOT WITH LIMITED NUMBER OF DRIVERS
20+
cp -r "packages/polyglot/src/"* "tmp/polyglot-tmp/"
21+
// remove everything under tmp/polyglot-tmp/LLM/Drivers/* except ./OpenAI and ./Gemini
22+
mv "tmp/polyglot-tmp/LLM/Drivers/OpenAI" "tmp/tmp1/OpenAI"
23+
mv "tmp/polyglot-tmp/LLM/Drivers/Gemini" "tmp/tmp1/Gemini"
24+
rm -rf tmp/polyglot-tmp/LLM/Drivers/*
25+
mv "tmp/tmp1/"* "tmp/polyglot-tmp/LLM/Drivers"
26+
rm -rf tmp/tmp1
27+
code2prompt "tmp/polyglot-tmp" -o "tmp/poly-cut.md"
28+
# remove tmp/polyglot-tmp
29+
rm -rf tmp/polyglot-tmp
30+
31+
# MAKE INSTRUCTOR WITH LIMITED NUMBER OF DRIVERS
32+
cp -r "packages/instructor/src/"* "tmp/instructor-tmp/"
33+
# remove everything under tmp/instructor-tmp/LLM/Drivers/* except ./OpenAI and ./Gemini
34+
rm -rf "tmp/instructor-tmp/Extras"
35+
code2prompt "tmp/instructor-tmp" -o "tmp/instructor-cut.md"
36+
rm -rf tmp/instructor-tmp

config/connections.php.bak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use Cognesy\Utils\Env;
3+
use Cognesy\Utils\Config\Env;
44

55
return [
66
'defaultPreset' => 'openai',

config/embed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use Cognesy\Utils\Env;
3+
use Cognesy\Utils\Config\Env;
44

55
return [
66
'defaultPreset' => 'openai',

config/http.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
'clientPresets' => [
77
'guzzle' => [
8-
'httpClientType' => 'guzzle',
8+
'httpClientDriver' => 'guzzle',
99
'connectTimeout' => 3,
1010
'requestTimeout' => 30,
1111
'idleTimeout' => -1,
@@ -14,7 +14,7 @@
1414
'failOnError' => true,
1515
],
1616
'symfony' => [
17-
'httpClientType' => 'symfony',
17+
'httpClientDriver' => 'symfony',
1818
'connectTimeout' => 1,
1919
'requestTimeout' => 30,
2020
'idleTimeout' => -1,
@@ -23,7 +23,7 @@
2323
'failOnError' => true,
2424
],
2525
'laravel' => [
26-
'httpClientType' => 'laravel',
26+
'httpClientDriver' => 'laravel',
2727
'connectTimeout' => 1,
2828
'requestTimeout' => 30,
2929
'idleTimeout' => -1,
@@ -32,7 +32,7 @@
3232
'failOnError' => true,
3333
],
3434
'http-ollama' => [
35-
'httpClientType' => 'guzzle',
35+
'httpClientDriver' => 'guzzle',
3636
'connectTimeout' => 1,
3737
'requestTimeout' => 90,
3838
'idleTimeout' => -1,

config/llm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use Cognesy\Utils\Env;
3+
use Cognesy\Utils\Config\Env;
44

55
return [
66
'defaultPreset' => 'openai',

config/web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use Cognesy\Utils\Env;
3+
use Cognesy\Utils\Config\Env;
44

55
return [
66
'defaultScraper' => 'none', // 'none' uses file_get_contents($url)

evals/LLMModes/run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Cognesy\Evals\Experiment;
1010
use Cognesy\Evals\Observers\Aggregate\AggregateExperimentObserver;
1111
use Cognesy\Polyglot\LLM\Enums\OutputMode;
12-
use Cognesy\Utils\Settings;
12+
use Cognesy\Utils\Config\Settings;
1313
use Evals\LLMModes\CompanyEval;
1414

1515
$data = new InferenceData(

examples/A02_Advanced/CustomClientParameters/run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use Cognesy\Instructor\StructuredOutput;
2222
use Cognesy\Polyglot\LLM\Data\LLMConfig;
2323
use Cognesy\Polyglot\LLM\Enums\OutputMode;
24-
use Cognesy\Utils\Env;
24+
use Cognesy\Utils\Config\Env;
2525
use Cognesy\Utils\Events\EventDispatcher;
2626
use Symfony\Component\HttpClient\HttpClient as SymfonyHttpClient;
2727

examples/A03_Troubleshooting/Settings/config/embed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use Cognesy\Utils\Env;
3+
use Cognesy\Utils\Config\Env;
44

55
return [
66
'defaultPreset' => 'openai',

examples/A03_Troubleshooting/Settings/config/http.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
'clientPresets' => [
77
'guzzle' => [
8-
'httpClientType' => 'guzzle',
8+
'httpClientDriver' => 'guzzle',
99
'connectTimeout' => 3,
1010
'requestTimeout' => 30,
1111
'idleTimeout' => -1,
@@ -14,7 +14,7 @@
1414
'failOnError' => true,
1515
],
1616
'symfony' => [
17-
'httpClientType' => 'symfony',
17+
'httpClientDriver' => 'symfony',
1818
'connectTimeout' => 1,
1919
'requestTimeout' => 30,
2020
'idleTimeout' => -1,
@@ -23,7 +23,7 @@
2323
'failOnError' => true,
2424
],
2525
'laravel' => [
26-
'httpClientType' => 'laravel',
26+
'httpClientDriver' => 'laravel',
2727
'connectTimeout' => 1,
2828
'requestTimeout' => 30,
2929
'idleTimeout' => -1,
@@ -32,7 +32,7 @@
3232
'failOnError' => true,
3333
],
3434
'http-ollama' => [
35-
'httpClientType' => 'guzzle',
35+
'httpClientDriver' => 'guzzle',
3636
'connectTimeout' => 1,
3737
'requestTimeout' => 90,
3838
'idleTimeout' => -1,

0 commit comments

Comments
 (0)