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

Refactors: Driver to Provider + misc updates #23

Merged
merged 4 commits into from
Oct 14, 2024
Merged

Refactors: Driver to Provider + misc updates #23

merged 4 commits into from
Oct 14, 2024

Conversation

sixlive
Copy link
Contributor

@sixlive sixlive commented Oct 13, 2024

Description

Drivers to Providers

Closes #19

  • Removes the concept of 'drivers' and now just uses providers.
  • Creates Ollama provider since it was previously using the OpenAI driver

Manager Resolution

Updates the provider manager to allow for resolution using the, new, Provider enum.

Prism::text()
    ->using('anthropic', 'claude-3-5-sonnet-20240620')
    ->prompt('introduce yourself')
    ->generate();
    
use EchoLabs\Prism\Enums\Provider;

Prism::text()
    ->using(Provider::Anthropic,  'claude-3-5-sonnet-20240620')
    ->prompt('introduce yourself')
    ->generate();

Misc refactors

  • Add the generate method in addition to __invoke for better readability

- Refactors Drivers to Providers
- Refactors manager to allow for provider class names as keys
@sixlive sixlive self-assigned this Oct 13, 2024
@sixlive sixlive marked this pull request as ready for review October 13, 2024 21:41
@sixlive sixlive changed the title Refactors: Driver to Provider + manager resolution updates Refactors: Driver to Provider + misc updates Oct 13, 2024
@sixlive sixlive merged commit 397fa8c into main Oct 14, 2024
4 checks passed
@sixlive sixlive deleted the refactors branch October 14, 2024 17:53
pushpak1300 pushed a commit to pushpak1300/prism that referenced this pull request Oct 16, 2024
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

Successfully merging this pull request may close these issues.

Refactor drivers and providers
1 participant