Skip to content

Inherited API-keys #230

Answered by collindutter
urlmonitor asked this question in Q&A
Sep 15, 2023 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

@urlmonitor As of v0.17.0, you can now more easily specify an embedding driver that uses your API key:

import os
from griptape.structures import Pipeline
from griptape.drivers import OpenAiChatPromptDriver, OpenAiEmbeddingDriver
from griptape.tasks import ToolkitTask
from griptape.tools import WebScraper

openai_api_key = os.environ["MY_OPENAI_API_KEY"]
llm_version = "gpt-4"
pipeline = Pipeline(
    prompt_driver=OpenAiChatPromptDriver(
        temperature=0,
        model=llm_version,
        api_key=openai_api_key,
    ),
    embedding_driver=OpenAiEmbeddingDriver(
        api_key=openai_api_key,
    ),
)

pipeline.add_tasks(
    ToolkitTask(
        "Answer the user's following questio…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@collindutter
Comment options

@collindutter
Comment options

@collindutter
Comment options

Answer selected by collindutter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants