AI_LoadAPIKeyError: Unable to get the generateText() to find the API key from .env file.

갤럭시초이·2024년 12월 3일

OpenAI

목록 보기
1/3

-문제: .evn.local 파일의 open ai key 못 읽어 오는 문제
-해결:

import { createOpenAI } from '@ai-sdk/openai';

const openai = createOpenAI({
apiKey: 'myApiKey' // should ideally be loaded from external place such as env variable
});

-참고:
https://github.com/vercel/ai/discussions/1978

0개의 댓글