Skip to content

Error retrieving the API Key #84

@Francisco84929495

Description

@Francisco84929495

I am new to LLMs in Matlab.

I am trying to run the example "Analyze Scientific Papers Using ChatGPT™ Function Calls"

This is the sequence of instructions BEFORE the error:

api_key = "key-here"

api_key =

"key-here"

f = openAIFunction("writePaperDetails", "Function to write paper details to a table.");
f = addParameter(f, "name", type="string", description="Name of the paper.");
f = addParameter(f, "url", type="string", description="URL containing the paper.");

However, when I try to execute the following instruction, an error message appears:

paperVerifier = openAIChat("You are an expert in filtering scientific papers. " + ...
"Given a certain topic, you are able to decide if the paper" + ...
" fits the given topic or not.");
Error using llms.internal.getApiKeyFromNvpOrEnv (line 20)
Unable to find API key. Either set environment variable OPENAI_API_KEY or specify name-value
argument "APIKey".

Error in openAIChat (line 141)
this.APIKey = llms.internal.getApiKeyFromNvpOrEnv(nvp,"OPENAI_API_KEY");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Any idea of what I am doing wrong?

Thank you.

Francisco

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions