morphic icon indicating copy to clipboard operation
morphic copied to clipboard

pplx-ai is conveniently OpenAI client-compatible

Open beierzhijin opened this issue 10 months ago • 1 comments

What is the Only writers can set a specific model? I use pplx-ai, my .env.local file is as follows:

# Used to set the base URL path for OpenAI API requests.
# If you need to set a BASE URL, uncomment and set the following:
# OPENAI_API_BASE=

# Used to set the model for OpenAI API requests.
# If not set, the default is gpt-4-turbo.
# OPENAI_API_MODEL='gpt-4-turbo'

# OpenAI API key retrieved here: https://platform.openai.com/api-keys
# OPENAI_API_KEY=

# Tavily API Key retrieved here: https://app.tavily.com/home
# TAVILY_API_KEY=

# Only writers can set a specific model. It must be compatible with the OpenAI API.
USE_SPECIFIC_API_FOR_WRITER=true
SPECIFIC_API_BASE=https://api.perplexity.ai
SPECIFIC_API_KEY=pplx-xxx
SPECIFIC_API_MODEL=sonar-small-online

Error Message: unhandledRejection: LoadAPIKeyError [AI_LoadAPIKeyError]: OpenAI API key is missing. Pass it using the 'apiKey' parameter or the OPENAI_API_KEY environment variable.

beierzhijin avatar Apr 28 '24 07:04 beierzhijin

OPENAI_API_KEY and TAVILY_API_KEY aren't optional values. If they are not set, an error will occur. https://github.com/miurla/morphic?tab=readme-ov-file#3-fill-out-secrets

Please refer to the Note.

Note: This project focuses on Generative UI and requires complex output from LLMs. Currently, it's assumed that the official OpenAI models will be used. Although it's possible to set up other models, if you use an OpenAI-compatible model, but we don't guarantee that it'll work. https://github.com/miurla/morphic?tab=readme-ov-file#3-fill-out-secrets

If pplx-ai is used, it needs to be set only for the Writer agent.

Reference: https://github.com/miurla/morphic/issues/36

miurla avatar Apr 28 '24 08:04 miurla