Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 1.39 KB

File metadata and controls

48 lines (34 loc) · 1.39 KB

Dapr AI LLM Example

An example of using the Dapr AI bindings as language models in langchain.

Prerequisites

The Dapr AI bindings assume you have created an Azure Open AI instance in Azure and deployed a language model named gpt-4. To use another language model service, update the ./resources/ai.yaml in the example folder.

Running locally

  1. Add Azure Open AI endpoint and key to a secrets.json file in the root of the repo

    {
       "azure-open-ai-endpoint": "<Azure Open AI endpoint>",
       "azure-open-ai-key": "<Azure Open AI key>",
    }
  2. Start the Dapr AI bindings pluggable component

    cd <dapr-ai-bindings source>/src/DaprAi.Components
    dotnet run
  3. Start the Dapr sidecar

    dapr run --app-id daprai --dapr-grpc-port 50001 --resources-path ./resources
  4. Start the Python module

    python3 main.py
  5. Observe the output:

    Rainbow Steps
    

    Due to variability in the language model response, you might get a different (but hopefully still inventive) answer.