Skip to content

Commit 07666ca

Browse files
committed
Release version 0.14.3
1 parent 7e08fae commit 07666ca

File tree

270 files changed

+4778
-1175
lines changed

Some content is hidden

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

270 files changed

+4778
-1175
lines changed

.github/workflows/php.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,8 @@ jobs:
4242
- name: Regenerate Autoloader
4343
run: composer dump-autoload
4444

45-
- name: Run test suite
46-
run: composer test
45+
# - name: Run test suite
46+
# run: composer test
47+
48+
- name: Run all tests
49+
run: ./bin/run-all-tests.sh

bin/composer-install-all.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e # stops script on first error
3+
4+
for dir in packages/*; do
5+
if [ -f "$dir/composer.json" ]; then
6+
echo "🔍 Updating dependencies in $dir"
7+
composer --working-dir="$dir" install --no-scripts --no-progress
8+
fi
9+
done

bin/composer-update-all.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e # stops script on first error
3+
4+
for dir in packages/*; do
5+
if [ -f "$dir/composer.json" ]; then
6+
echo "🔍 Updating dependencies in $dir"
7+
composer --working-dir="$dir" update --no-scripts --no-progress
8+
fi
9+
done

bin/publish-ver.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ PACKAGES["packages/http-client"]="cognesy/instructor-http-client"
3535
PACKAGES["packages/hub"]="cognesy/instructor-hub"
3636
PACKAGES["packages/setup"]="cognesy/instructor-setup"
3737
PACKAGES["packages/tell"]="cognesy/instructor-tell"
38+
PACKAGES["packages/experimental"]="cognesy/instructor-experimental"
3839

3940
# 1. Update all package versions using sync-ver.sh
4041
echo "Step 1: Updating package versions..."

bin/run-all-tests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e # stops script on first error
3+
4+
for dir in packages/*; do
5+
if [ -f "$dir/composer.json" ]; then
6+
echo "🔍 Running tests in $dir"
7+
composer --working-dir="$dir" test
8+
fi
9+
done

bin/sync-ver.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ echo "Updating to version $VERSION (dependency constraint ^$MAJOR_MINOR)"
2020

2121
# Define packages and their sections based on composer.json
2222
declare -A PACKAGES
23-
PACKAGES["packages/utils"]="cognesy/instructor-utils"
2423
PACKAGES["packages/addons"]="cognesy/instructor-addons"
25-
PACKAGES["packages/polyglot"]="cognesy/instructor-polyglot"
26-
PACKAGES["packages/instructor"]="cognesy/instructor-struct"
2724
PACKAGES["packages/auxiliary"]="cognesy/instructor-auxiliary"
25+
PACKAGES["packages/experimental"]="cognesy/instructor-experimental"
2826
PACKAGES["packages/http-client"]="cognesy/instructor-http-client"
2927
PACKAGES["packages/hub"]="cognesy/instructor-hub"
28+
PACKAGES["packages/instructor"]="cognesy/instructor-struct"
29+
PACKAGES["packages/polyglot"]="cognesy/instructor-polyglot"
3030
PACKAGES["packages/setup"]="cognesy/instructor-setup"
3131
PACKAGES["packages/tell"]="cognesy/instructor-tell"
32+
PACKAGES["packages/utils"]="cognesy/instructor-utils"
3233

3334
# Define which packages go in which section of the main composer.json
3435
declare -A MAIN_REQUIRE_PACKAGES
@@ -43,6 +44,7 @@ MAIN_REQUIRE_DEV_PACKAGES["packages/http-client"]="cognesy/instructor-http-clien
4344
MAIN_REQUIRE_DEV_PACKAGES["packages/hub"]="cognesy/instructor-hub"
4445
MAIN_REQUIRE_DEV_PACKAGES["packages/setup"]="cognesy/instructor-setup"
4546
MAIN_REQUIRE_DEV_PACKAGES["packages/tell"]="cognesy/instructor-tell"
47+
MAIN_REQUIRE_DEV_PACKAGES["packages/experimental"]="cognesy/instructor-experimental"
4648

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

composer.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,17 @@
4444
"Cognesy\\Experimental\\": "packages/experimental/src/",
4545
"Cognesy\\Evals\\": "evals/",
4646
"Examples\\": "examples/",
47-
"Tests\\": "tests/"
47+
"Tests\\": "tests/",
48+
"Cognesy\\Addons\\Tests\\": "packages/addons/tests/",
49+
"Cognesy\\Auxiliary\\Tests\\": "packages/auxiliary/tests/",
50+
"Cognesy\\Experimental\\Tests\\": "packages/experimental/tests/",
51+
"Cognesy\\Http\\Tests\\": "packages/http-client/tests/",
52+
"Cognesy\\InstructorHub\\Tests\\": "packages/hub/tests/",
53+
"Cognesy\\Instructor\\Tests\\": "packages/instructor/tests/",
54+
"Cognesy\\Polyglot\\Tests\\": "packages/polyglot/tests/",
55+
"Cognesy\\Setup\\Tests\\": "packages/setup/tests/",
56+
"Cognesy\\Tell\\Tests\\": "packages/tell/tests/",
57+
"Cognesy\\Utils\\Tests\\": "packages/utils/tests/"
4858
},
4959
"files": [
5060
"tests/Examples/Call/test_functions.php"

docs/cookbook/introduction.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ $ ./bin/instructor hub list
4040

4141
### List Cookbooks
4242

43-
Run `./hub.sh list` you can see all the available tutorials and examples.
43+
Run `./bin/instructor hub list` you can see all the available tutorials and examples.
4444

4545
```bash
4646
$ ./bin/instructor hub list
4747
```
4848

4949
### Reading a Cookbook
5050

51-
To read a tutorial, you can run `./hub.sh show {id}` to see the full tutorial in the terminal.
51+
To read a tutorial, you can run `./bin/instructor hub show {id}` to see the full tutorial in the terminal.
5252

5353
```bash
5454
$ ./bin/instructor hub show {id}
@@ -60,7 +60,7 @@ Currently, there is no way to page through the tutorial - feel free to contribut
6060

6161
### Running a Cookbook
6262

63-
To run a tutorial, you run `./hub.sh run {id}` in terminal - it will execute the code and show the output. You need to have your OPENAI_API_KEY set in your environment (.env file in root directory of your copy of instructor-php repo).
63+
To run a tutorial, you run `./bin/instructor hub run {id}` in terminal - it will execute the code and show the output. You need to have your OPENAI_API_KEY set in your environment (.env file in root directory of your copy of instructor-php repo).
6464

6565
```bash
6666
$ ./bin/instructor hub run {id}
@@ -69,7 +69,7 @@ $ ./bin/instructor hub run {id}
6969

7070
### Running all Cookbooks
7171

72-
This is mostly for testing if cookbooks are executed properly, but you can run `./hub.sh all {id}` to run all the tutorials and examples in the terminal, starting from the one you specify.
72+
This is mostly for testing if cookbooks are executed properly, but you can run `./bin/instructor hub all {id}` to run all the tutorials and examples in the terminal, starting from the one you specify.
7373

7474
```bash
7575
$ ./bin/instructor hub all {id}

docs/mint.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@
131131
{
132132
"group": "Release Notes",
133133
"pages": [
134+
"release-notes/v0.14.3",
135+
"release-notes/v0.14.2",
134136
"release-notes/v0.14.1",
135137
"release-notes/v0.14.0",
136138
"release-notes/v0.13.0",

docs/release-notes/v0.14.3.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- (all) Corrected dependencies in composer.json files for all packages
2+
- (utils) Removed circular dependency on addons package (via Image class)
3+
- (all) Tests moved under packages/*/tests directories
4+
- (all) Added .gitattributes file to all packages
5+
- (all) Corrected .gitignore files in all packages
6+
- (main) Scripts added in ./bin to install & update composer dependencies and run all tests
7+
- (main) Corrected php.yml to use the new script ./bin/run-all-tests.sh
8+
- (docs) Corrected docs references: old example viewer & launcher script (./hub.sh) to new (./bin/instructor hub)

0 commit comments

Comments
 (0)