GithubHelp home page GithubHelp logo

baldurrensch / instructrice-bundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adrienbrault/instructrice-bundle

0.0 0.0 0.0 20 KB

๐Ÿ‘ฉโ€๐Ÿซ Structured Data Extraction in Symfony

License: MIT License

Shell 4.49% PHP 95.51%

instructrice-bundle's Introduction

Symfony bundle for the adrienbrault/instructrice library.

Install the bundle:

composer require adrienbrault/instructrice-bundle:dev-main adrienbrault/instructrice:dev-main

Configure api keys:

# config/packages/instructrice.yaml
instructrice:
    anthropic:
        api_key: '%env(ANTHROPIC_API_KEY)'
    anyscale:
        api_key: '%env(ANYSCALE_API_KEY)'
    deepinfra:
        api_key: '%env(DEEPINFRA_API_KEY)'
    fireworks:
        api_key: '%env(FIREWORKS_API_KEY)'
    groq:
        api_key: '%env(GROQ_API_KEY)'
    mistral:
        api_key: '%env(MISTRAL_API_KEY)'
    ollama:
        api_key: '%env(OLLAMA_API_KEY)'
    openai:
        api_key: '%env(OPENAI_API_KEY)'
    perplexity:
        api_key: '%env(PERPLEXITY_API_KEY)'
    together:
        api_key: '%env(TOGETHER_API_KEY)'

Use instructrice:

use AdrienBrault\Instructrice\Instructrice;
use AdrienBrault\Instructrice\LLM\Provider\OpenAi;

public function controller(Instructrice $instructrice)
{
    $sentiment = $instructrice->get(
        type: [
            'type' => 'string',
            'enum' => ['positive', 'neutral', 'negative'],
        ],
        'Pretty descent!',
        'Sentiment analysis',
        llm: OpenAi::GPT_4T
    );
}

instructrice-bundle's People

Contributors

adrienbrault avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.