-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added symfony/filesystem to dependencies
- Loading branch information
1 parent
a177250
commit e410357
Showing
3 changed files
with
78 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,76 @@ | ||
## Running cookbooks with Instructor Hub tool | ||
|
||
Welcome to Instructor cookbooks. The goal of this section is to provide a set of tutorials and examples to help you get started. | ||
|
||
|
||
|
||
## CLI Usage | ||
|
||
Instructor comes with a CLI tool that allows you to view and interact with the tutorials and examples and allows you to find the code snippets you may need to get solution to your problem. | ||
|
||
|
||
|
||
### List Cookbooks | ||
|
||
Run `./hub.sh list` you can see all the available tutorials and examples. | ||
|
||
```bash | ||
$ ./hub.sh list | ||
``` | ||
...or on Windows: | ||
|
||
```cli | ||
$ ./hub.bat list | ||
``` | ||
|
||
### Reading a Cookbook | ||
|
||
To read a tutorial, you can run `./hub.sh show {id}` to see the full tutorial in the terminal. | ||
|
||
```bash | ||
$ ./hub.sh show {name or id} | ||
``` | ||
|
||
Currently, there is no way to page through the tutorial - feel free to contribute :) | ||
|
||
|
||
### Running a Cookbook | ||
|
||
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). | ||
|
||
```bash | ||
$ ./hub.sh run {name or id} | ||
``` | ||
|
||
|
||
### Running all Cookbooks | ||
|
||
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. | ||
|
||
```bash | ||
$ ./hub.sh all {name or id} | ||
``` | ||
|
||
--- | ||
title: Instructor Cookbooks | ||
description: Running and viewing cookbooks with Instructor Hub tool | ||
--- | ||
|
||
## Overview | ||
|
||
Welcome to Instructor cookbooks. The goal of this section is to provide a set of tutorials and examples to help you get started. | ||
|
||
Instructor comes with a CLI tool that allows you to view and interact with the tutorials and examples and allows you to find the code snippets you may need to get solution to your problem. | ||
|
||
<Warning> | ||
Examples are only available with Instructor project cloned locally. | ||
We did not want to include them in the Composer package to keep it lightweight. | ||
</Warning> | ||
|
||
### Step 1: Clone Instructor project from Github | ||
|
||
To get access to the tutorials and examples, you need to clone the Instructor project from Github: | ||
|
||
```bash | ||
$ git clone https://github.com/cognesy/instructor-php.git | ||
``` | ||
|
||
### Step 2: Create `.env` file | ||
|
||
Create a `.env` file in the root directory of your copy of Instructor project and set your LLM API key(s). | ||
You can use the `.env-dist` file as a template. | ||
|
||
### Step 3: Check the available tutorials | ||
|
||
You can check the available tutorials and examples by running the following command in terminal: | ||
|
||
```bash | ||
$ ./bin/instructor hub list | ||
``` | ||
|
||
|
||
## Available CLI Commands | ||
|
||
### List Cookbooks | ||
|
||
Run `./hub.sh list` you can see all the available tutorials and examples. | ||
|
||
```bash | ||
$ ./bin/instructor hub list | ||
``` | ||
|
||
### Reading a Cookbook | ||
|
||
To read a tutorial, you can run `./hub.sh show {id}` to see the full tutorial in the terminal. | ||
|
||
```bash | ||
$ ./bin/instructor hub show {id} | ||
``` | ||
|
||
Currently, there is no way to page through the tutorial - feel free to contribute :) | ||
|
||
|
||
|
||
### Running a Cookbook | ||
|
||
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). | ||
|
||
```bash | ||
$ ./bin/instructor hub run {id} | ||
``` | ||
|
||
|
||
### Running all Cookbooks | ||
|
||
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. | ||
|
||
```bash | ||
$ ./bin/instructor hub all {id} | ||
``` |