Skip to content

Commit 96f9800

Browse files
committed
Release version 0.14.7
1 parent 8d808d7 commit 96f9800

File tree

161 files changed

+659
-308
lines changed

Some content is hidden

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

161 files changed

+659
-308
lines changed

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,25 @@ Here's a simple CLI demo app using Instructor to extract structured data from te
2323

2424
This repository is a monorepo containing all Instructor's components (required and optional). It hosts all that you need to work with LLMs via Instructor.
2525

26-
Individual components are distributed also as standalone packages that can be used independently.
26+
Individual components are also distributed as standalone packages that can be used independently.
2727

2828
![image](docs/images/instructor-packages.png)
2929

30-
Links to read-only repositories of the individual packages:
31-
- [instructor-struct](https://github.com/cognesy/instructor-struct) - get dev friendly structured outputs from LLMs
32-
- [instructor-polyglot](https://github.com/cognesy/instructor-polyglot) - use single API for inference and embeddings across most of LLM providers, easily switch between them (e.g., develop on Ollama, switch to Groq in production)
33-
- [instructor-http-client](https://github.com/cognesy/instructor-http-client) - easily switch between underlying HTTP client libraries (out-of-the-box support for Guzzle, Symfony, Laravel)
34-
- [instructor-aux](https://github.com/cognesy/instructor-aux) - external tools and integrations, e.g. used by Instructor examples
35-
- [instructor-addons](https://github.com/cognesy/instructor-addons) - extra capabilities and common LLM-related problem solutions
36-
- [instructor-utils](https://github.com/cognesy/instructor-utils) - common utility classes used by Instructor packages
37-
- [instructor-setup](https://github.com/cognesy/instructor-setup) - CLI tool for publishing Instructor config files in your app
38-
- [instructor-hub](https://github.com/cognesy/instructor-hub) - CLI tool for browsing and running Instructor examples
39-
- [instructor-tell](https://github.com/cognesy/instructor-tell) - CLI tool for executing LLM prompts in your terminal
30+
Links to read-only repositories of the standalone package distributions:
31+
32+
- [instructor-addons](https://github.com/cognesy/instructor-addons) - extra capabilities and common LLM-related problem solutions
33+
- [instructor-aux](https://github.com/cognesy/instructor-aux) - external tools and integrations, e.g. used by Instructor examples
34+
- [instructor-evals](https://github.com/cognesy/instructor-evals) - LLM output evaluation tools
35+
- [instructor-http-client](https://github.com/cognesy/instructor-http-client) - easily switch between underlying HTTP client libraries (out-of-the-box support for Guzzle, Symfony, Laravel)
36+
- [instructor-hub](https://github.com/cognesy/instructor-hub) - CLI tool for browsing and running Instructor examples
37+
- [instructor-polyglot](https://github.com/cognesy/instructor-polyglot) - use single API for inference and embeddings across most of LLM providers, easily switch between them (e.g., develop on Ollama, switch to Groq in production)
38+
- [instructor-setup](https://github.com/cognesy/instructor-setup) - CLI tool for publishing Instructor config files in your app
39+
- [instructor-struct](https://github.com/cognesy/instructor-struct) - get dev friendly structured outputs from LLMs
40+
- [instructor-tell](https://github.com/cognesy/instructor-tell) - CLI tool for executing LLM prompts in your terminal
41+
- [instructor-templates](https://github.com/cognesy/instructor-templates) - text and chat template tools used by Instructor, support Twig, Blade and ArrowPipe formats
42+
- [instructor-utils](https://github.com/cognesy/instructor-utils) - common utility classes used by Instructor packages
43+
44+
> NOTE: If you are just starting to use Instructor, I recommend using the `instructor-php` package. It contains all the required components and is the easiest way to get started with the library.
4045
4146

4247

@@ -92,10 +97,11 @@ Links to read-only repositories of the individual packages:
9297

9398
- Developer friendly LLM context caching for reduced costs and faster inference (for Anthropic models)
9499
- Developer friendly data extraction from images (for OpenAI, Anthropic and Gemini models)
100+
- Generate vector embeddings using APIs of multiple supported LLM providers
95101

96102
### Documentation and examples
97103

98-
- Learn more from growing documentation and 50+ cookbooks
104+
- Learn more from growing documentation and 100+ cookbooks
99105

100106

101107

@@ -958,11 +964,6 @@ Additional dependencies are required for some extras:
958964
- spatie/array-to-xml
959965
- gioni06/gpt3-tokenizer
960966

961-
## TODOs
962-
963-
- [ ] Async support
964-
- [ ] Documentation
965-
966967

967968
## Contributing
968969

bin/composer-install-all.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -e # stops script on first error
44
for dir in packages/*; do
55
if [ -f "$dir/composer.json" ]; then
66
echo "🔍 Updating dependencies in $dir"
7+
composer --working-dir="$dir" clear-cache
8+
composer --working-dir="$dir" dump-autoload
79
composer --working-dir="$dir" install --no-scripts --no-progress
810
fi
911
done

bin/publish-ver.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@ echo "Using release notes from: $NOTES_FILE"
2626

2727
# Define packages - must match those in sync-ver.sh
2828
declare -A PACKAGES
29-
PACKAGES["packages/utils"]="cognesy/instructor-utils"
3029
PACKAGES["packages/addons"]="cognesy/instructor-addons"
31-
PACKAGES["packages/polyglot"]="cognesy/instructor-polyglot"
32-
PACKAGES["packages/instructor"]="cognesy/instructor-struct"
3330
PACKAGES["packages/auxiliary"]="cognesy/instructor-auxiliary"
31+
PACKAGES["packages/evals"]="cognesy/instructor-evals"
32+
PACKAGES["packages/experimental"]="cognesy/instructor-experimental"
3433
PACKAGES["packages/http-client"]="cognesy/instructor-http-client"
3534
PACKAGES["packages/hub"]="cognesy/instructor-hub"
35+
PACKAGES["packages/instructor"]="cognesy/instructor-struct"
36+
PACKAGES["packages/polyglot"]="cognesy/instructor-polyglot"
3637
PACKAGES["packages/setup"]="cognesy/instructor-setup"
3738
PACKAGES["packages/tell"]="cognesy/instructor-tell"
38-
PACKAGES["packages/experimental"]="cognesy/instructor-experimental"
39+
PACKAGES["packages/templates"]="cognesy/instructor-templates"
40+
PACKAGES["packages/utils"]="cognesy/instructor-utils"
3941

4042
# 0. Build docs
4143
echo "Step 0: Rebuilding documentation..."

bin/sync-ver.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,33 @@ echo "Updating to version $VERSION (dependency constraint ^$MAJOR_MINOR)"
2222
declare -A PACKAGES
2323
PACKAGES["packages/addons"]="cognesy/instructor-addons"
2424
PACKAGES["packages/auxiliary"]="cognesy/instructor-auxiliary"
25+
PACKAGES["packages/evals"]="cognesy/instructor-evals"
2526
PACKAGES["packages/experimental"]="cognesy/instructor-experimental"
2627
PACKAGES["packages/http-client"]="cognesy/instructor-http-client"
2728
PACKAGES["packages/hub"]="cognesy/instructor-hub"
2829
PACKAGES["packages/instructor"]="cognesy/instructor-struct"
2930
PACKAGES["packages/polyglot"]="cognesy/instructor-polyglot"
3031
PACKAGES["packages/setup"]="cognesy/instructor-setup"
3132
PACKAGES["packages/tell"]="cognesy/instructor-tell"
33+
PACKAGES["packages/templates"]="cognesy/instructor-templates"
3234
PACKAGES["packages/utils"]="cognesy/instructor-utils"
3335

3436
# Define which packages go in which section of the main composer.json
3537
declare -A MAIN_REQUIRE_PACKAGES
36-
MAIN_REQUIRE_PACKAGES["packages/utils"]="cognesy/instructor-utils"
3738
MAIN_REQUIRE_PACKAGES["packages/addons"]="cognesy/instructor-addons"
38-
MAIN_REQUIRE_PACKAGES["packages/polyglot"]="cognesy/instructor-polyglot"
39+
MAIN_REQUIRE_PACKAGES["packages/http-client"]="cognesy/instructor-http-client"
3940
MAIN_REQUIRE_PACKAGES["packages/instructor"]="cognesy/instructor-struct"
41+
MAIN_REQUIRE_PACKAGES["packages/polyglot"]="cognesy/instructor-polyglot"
42+
MAIN_REQUIRE_PACKAGES["packages/setup"]="cognesy/instructor-setup"
43+
MAIN_REQUIRE_PACKAGES["packages/templates"]="cognesy/instructor-templates"
44+
MAIN_REQUIRE_PACKAGES["packages/utils"]="cognesy/instructor-utils"
4045

4146
declare -A MAIN_REQUIRE_DEV_PACKAGES
4247
MAIN_REQUIRE_DEV_PACKAGES["packages/auxiliary"]="cognesy/instructor-auxiliary"
43-
MAIN_REQUIRE_DEV_PACKAGES["packages/http-client"]="cognesy/instructor-http-client"
48+
MAIN_REQUIRE_DEV_PACKAGES["packages/evals"]="cognesy/instructor-evals"
49+
MAIN_REQUIRE_DEV_PACKAGES["packages/experimental"]="cognesy/instructor-experimental"
4450
MAIN_REQUIRE_DEV_PACKAGES["packages/hub"]="cognesy/instructor-hub"
45-
MAIN_REQUIRE_DEV_PACKAGES["packages/setup"]="cognesy/instructor-setup"
4651
MAIN_REQUIRE_DEV_PACKAGES["packages/tell"]="cognesy/instructor-tell"
47-
MAIN_REQUIRE_DEV_PACKAGES["packages/experimental"]="cognesy/instructor-experimental"
4852

4953
# Check if jq is installed
5054
if ! command -v jq &> /dev/null; then

bin/test-publish.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,18 @@ echo "Using release notes from: $NOTES_FILE"
3030

3131
# Define packages - must match those in sync-ver.sh
3232
declare -A PACKAGES
33-
PACKAGES["packages/utils"]="cognesy/instructor-utils"
3433
PACKAGES["packages/addons"]="cognesy/instructor-addons"
35-
PACKAGES["packages/polyglot"]="cognesy/instructor-polyglot"
36-
PACKAGES["packages/instructor"]="cognesy/instructor-struct"
3734
PACKAGES["packages/auxiliary"]="cognesy/instructor-auxiliary"
35+
PACKAGES["packages/evals"]="cognesy/instructor-evals"
36+
PACKAGES["packages/experimental"]="cognesy/instructor-experimental"
3837
PACKAGES["packages/http-client"]="cognesy/instructor-http-client"
3938
PACKAGES["packages/hub"]="cognesy/instructor-hub"
39+
PACKAGES["packages/instructor"]="cognesy/instructor-struct"
40+
PACKAGES["packages/polyglot"]="cognesy/instructor-polyglot"
4041
PACKAGES["packages/setup"]="cognesy/instructor-setup"
4142
PACKAGES["packages/tell"]="cognesy/instructor-tell"
43+
PACKAGES["packages/templates"]="cognesy/instructor-templates"
44+
PACKAGES["packages/utils"]="cognesy/instructor-utils"
4245

4346
# Create a backup directory
4447
BACKUP_DIR="test_backup_$(date +%Y%m%d_%H%M%S)"

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
"Cognesy\\Addons\\": "packages/addons/src/",
3131
"Cognesy\\Http\\": "packages/http-client/src/",
3232
"Cognesy\\Instructor\\": "packages/instructor/src/",
33+
"Cognesy\\Messages\\": "packages/messages/src/",
3334
"Cognesy\\Polyglot\\": "packages/polyglot/src/",
3435
"Cognesy\\Setup\\": "packages/setup/src/",
36+
"Cognesy\\Template\\": "packages/templates/src/",
3537
"Cognesy\\Utils\\": "packages/utils/src/"
3638
},
3739
"files": []
@@ -50,9 +52,11 @@
5052
"Cognesy\\Http\\Tests\\": "packages/http-client/tests/",
5153
"Cognesy\\InstructorHub\\Tests\\": "packages/hub/tests/",
5254
"Cognesy\\Instructor\\Tests\\": "packages/instructor/tests/",
55+
"Cognesy\\Messages\\Tests\\": "packages/messages/tests/",
5356
"Cognesy\\Polyglot\\Tests\\": "packages/polyglot/tests/",
5457
"Cognesy\\Setup\\Tests\\": "packages/setup/tests/",
5558
"Cognesy\\Tell\\Tests\\": "packages/tell/tests/",
59+
"Cognesy\\Templates\\Tests\\": "packages/templates/tests/",
5660
"Cognesy\\Utils\\Tests\\": "packages/utils/tests/",
5761
"Evals\\": "evals/",
5862
"Examples\\": "examples/",

docs-build/cookbook/instructor/api_support/minimaxi.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Mode compatibility:
1919
<?php
2020
require 'examples/boot.php';
2121

22+
use Cognesy\Http\Debug\Debug;
2223
use Cognesy\Instructor\Instructor;
2324
use Cognesy\Polyglot\LLM\Enums\Mode;
24-
use Cognesy\Utils\Debug\Debug;
2525

2626
enum UserType : string {
2727
case Guest = 'guest';

docs-build/cookbook/instructor/api_support/moonshotai.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Mode compatibility:
1919
<?php
2020
require 'examples/boot.php';
2121

22+
use Cognesy\Http\Debug\Debug;
2223
use Cognesy\Instructor\Instructor;
2324
use Cognesy\Polyglot\LLM\Enums\Mode;
24-
use Cognesy\Utils\Debug\Debug;
2525

2626
enum UserType : string {
2727
case Guest = 'guest';

docs-build/cookbook/instructor/api_support/sambanova.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Mode compatibility:
1919
<?php
2020
require 'examples/boot.php';
2121

22+
use Cognesy\Http\Debug\Debug;
2223
use Cognesy\Instructor\Instructor;
2324
use Cognesy\Polyglot\LLM\Enums\Mode;
24-
use Cognesy\Utils\Debug\Debug;
2525

2626
enum UserType : string {
2727
case Guest = 'guest';

docs-build/cookbook/instructor/extras/complex_extraction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ the provided text.
1414
<?php
1515
require 'examples/boot.php';
1616

17+
use Cognesy\Http\Debug\Debug;
1718
use Cognesy\Instructor\Extras\Sequence\Sequence;
1819
use Cognesy\Instructor\Instructor;
1920
use Cognesy\Polyglot\LLM\Enums\Mode;
20-
use Cognesy\Utils\Debug\Debug;
2121

2222
$report = <<<'EOT'
2323
[2021-09-01]

0 commit comments

Comments
 (0)