Skip to content

Commit 7d494ba

Browse files
author
Dariusz Debowczyk
committed
Inlined bootstrap in Instructor bin/* scripts
1 parent 67f0db5 commit 7d494ba

Some content is hidden

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

53 files changed

+895
-1885
lines changed

bin/ins-hub

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@ ini_set('display_errors', 1);
44
ini_set('display_startup_errors', 1);
55
error_reporting(E_ALL);
66

7-
require __DIR__ . '/bootstrap.php';
7+
function findAutoload()
8+
{
9+
$dir = __DIR__;
10+
$previousDir = '';
11+
12+
while ($dir !== $previousDir) {
13+
$autoload = $dir . '/vendor/autoload.php';
14+
if (file_exists($autoload)) {
15+
return $autoload;
16+
}
17+
$previousDir = $dir;
18+
$dir = dirname($dir);
19+
}
20+
21+
throw new RuntimeException('Unable to locate vendor/autoload.php. Please ensure you have run "composer install".');
22+
}
23+
24+
require findAutoload();
825
echo "Running Instructor Hub\n";
926

1027
// run the app

bin/ins-setup

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,24 @@
22
<?php
33
namespace Cognesy\Setup;
44

5-
require __DIR__ . '/bootstrap.php';
5+
function findAutoload()
6+
{
7+
$dir = __DIR__;
8+
$previousDir = '';
9+
10+
while ($dir !== $previousDir) {
11+
$autoload = $dir . '/vendor/autoload.php';
12+
if (file_exists($autoload)) {
13+
return $autoload;
14+
}
15+
$previousDir = $dir;
16+
$dir = dirname($dir);
17+
}
18+
19+
throw new RuntimeException('Unable to locate vendor/autoload.php. Please ensure you have run "composer install".');
20+
}
21+
22+
require findAutoload();
623

724
use Symfony\Component\Console\Application;
825

bin/tell

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,24 @@
22
<?php
33
namespace Cognesy\Tell;
44

5-
require __DIR__ . '/bootstrap.php';
5+
function findAutoload()
6+
{
7+
$dir = __DIR__;
8+
$previousDir = '';
9+
10+
while ($dir !== $previousDir) {
11+
$autoload = $dir . '/vendor/autoload.php';
12+
if (file_exists($autoload)) {
13+
return $autoload;
14+
}
15+
$previousDir = $dir;
16+
$dir = dirname($dir);
17+
}
18+
19+
throw new RuntimeException('Unable to locate vendor/autoload.php. Please ensure you have run "composer install".');
20+
}
21+
22+
require findAutoload();
623

724
use Symfony\Component\Console\Application;
825

packages/hub/.env-dist

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
#########################################################
2-
# INSTRUCTOR SECRETS
3-
#########################################################
4-
5-
INSTRUCTOR_CONFIG_PATH='../config/'
6-
7-
#########################################################
8-
# LLMS
9-
#########################################################
10-
11-
A21_API_KEY=''
12-
ANTHROPIC_API_KEY=''
13-
ANYSCALE_API_KEY=''
14-
AZURE_OPENAI_API_KEY=''
15-
CEREBRAS_API_KEY=''
16-
COHERE_API_KEY=''
17-
FIREWORKS_API_KEY=''
18-
GEMINI_API_KEY=''
19-
GROQ_API_KEY=''
20-
MISTRAL_API_KEY=''
21-
OLLAMA_API_KEY=''
22-
OPENAI_API_KEY=''
23-
OPENROUTER_API_KEY=''
24-
SAMBANOVA_API_KEY=''
25-
TOGETHER_API_KEY=''
26-
XAI_API_KEY=''
27-
28-
#########################################################
29-
# EMBEDDINGS
30-
#########################################################
31-
32-
AZURE_OPENAI_EMBED_API_KEY=''
33-
JINA_API_KEY=''
34-
35-
#########################################################
36-
# SCRAPERS
37-
#########################################################
38-
39-
JINAREADER_API_KEY=''
40-
SCRAPFLY_API_KEY=''
41-
SCRAPINGBEE_API_KEY=''
42-
43-
#########################################################
44-
# MISC
45-
#########################################################
46-
47-
SHOWCODE_API_KEY=''
1+
#########################################################
2+
# INSTRUCTOR SECRETS
3+
#########################################################
4+
5+
INSTRUCTOR_CONFIG_PATH='../config/'
6+
7+
#########################################################
8+
# LLMS
9+
#########################################################
10+
11+
A21_API_KEY=''
12+
ANTHROPIC_API_KEY=''
13+
ANYSCALE_API_KEY=''
14+
AZURE_OPENAI_API_KEY=''
15+
CEREBRAS_API_KEY=''
16+
COHERE_API_KEY=''
17+
FIREWORKS_API_KEY=''
18+
GEMINI_API_KEY=''
19+
GROQ_API_KEY=''
20+
MISTRAL_API_KEY=''
21+
OLLAMA_API_KEY=''
22+
OPENAI_API_KEY=''
23+
OPENROUTER_API_KEY=''
24+
SAMBANOVA_API_KEY=''
25+
TOGETHER_API_KEY=''
26+
XAI_API_KEY=''
27+
28+
#########################################################
29+
# EMBEDDINGS
30+
#########################################################
31+
32+
AZURE_OPENAI_EMBED_API_KEY=''
33+
JINA_API_KEY=''
34+
35+
#########################################################
36+
# SCRAPERS
37+
#########################################################
38+
39+
JINAREADER_API_KEY=''
40+
SCRAPFLY_API_KEY=''
41+
SCRAPINGBEE_API_KEY=''
42+
43+
#########################################################
44+
# MISC
45+
#########################################################
46+
47+
SHOWCODE_API_KEY=''

packages/hub/bin/ins-hub

100644100755
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@ ini_set('display_errors', 1);
44
ini_set('display_startup_errors', 1);
55
error_reporting(E_ALL);
66

7-
require __DIR__ . '/bootstrap.php';
7+
function findAutoload()
8+
{
9+
$dir = __DIR__;
10+
$previousDir = '';
11+
12+
while ($dir !== $previousDir) {
13+
$autoload = $dir . '/vendor/autoload.php';
14+
if (file_exists($autoload)) {
15+
return $autoload;
16+
}
17+
$previousDir = $dir;
18+
$dir = dirname($dir);
19+
}
20+
21+
throw new RuntimeException('Unable to locate vendor/autoload.php. Please ensure you have run "composer install".');
22+
}
23+
24+
require findAutoload();
825
echo "Running Instructor Hub\n";
926

1027
// run the app

packages/hub/prompts/archive/cia.twig

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)