Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command #6

Open
adrienbrault opened this issue Apr 25, 2024 · 4 comments
Open

Command #6

adrienbrault opened this issue Apr 25, 2024 · 4 comments

Comments

@adrienbrault
Copy link
Owner

Ideally, you install the symfony bundle and can start trying to type outputs with your existing models

@adrienbrault
Copy link
Owner Author

With several output format: dump, json, yaml

@adrienbrault
Copy link
Owner Author

Kind of do this:

if ($llm === null) {
$providerModels = reindex(
$llmFactory->getAvailableProviderModels(),
fn (ProviderModel $providerModel) => $providerModel->createConfig('123')->getLabel(),
);
$questionSection = $output->section();
$questionHelper = new QuestionHelper();
$llmToUse = $questionHelper->ask($input, $questionSection, new ChoiceQuestion(
'Which LLM do you want to use?',
array_keys($providerModels),
0,
));
$questionSection->clear();
$llm = $providerModels[$llmToUse];
assert($llm instanceof ProviderModel);
}
$output->writeln(sprintf('Using LLM: <info>%s</info>', $llm->createConfig('123')->getLabel()));
$output->writeln('');
$instructrice = InstructriceFactory::create(
defaultLlm: $llm,
logger: $logger,
llmFactory: $llmFactory
);

@adrienbrault
Copy link
Owner Author

Killer feature would be to detect if the context given to the command is an url and automatically use r.jina.ai to scrape:

$ vendor/bin/instructrice '{"type":"string","description": "xxx"}' https://www.php.net/releases/8.3/en.php 'Find all the new features'

Fetching https://www.php.net/releases/8.3/en.php markdown content using r.jina.ai

@adrienbrault
Copy link
Owner Author

#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant