Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Model 'undefined' not found in any provider #674

Open
Zebartin opened this issue Apr 20, 2024 · 2 comments
Open

[BUG] Model 'undefined' not found in any provider #674

Zebartin opened this issue Apr 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Zebartin
Copy link

Describe the bug
When testing example given in document about API of AI module, code throws an error reading as follows:

QuickAdd: (ERROR) Could not create file with template: 
Model 'undefined' not found in any provider

I have tried different values from api.ai.getModels() for model, but all end up with the same error.

To Reproduce
Steps to reproduce the behavior:

  1. Create an template file with content:
```js quickadd
const promptText = "What is the capital of France?";
const model = "gpt-4";

const settings = {
    variableName: "capital",
    shouldAssignVariables: true,
    modelOptions: {
        temperature: 0.6,
        max_tokens: 60,
        frequency_penalty: 0.5,
        presence_penalty: 0.5
    },
    showAssistantMessages: true,
    systemPrompt: "Please provide the answer"
};

const response = await this.quickAddApi.ai.prompt(promptText, model, settings);
console.log(response);
```
  1. Set up QuickAdd for the template above
  2. Run the template with QuickAdd
  3. See error

Expected behavior
No error is shown and new file is created

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10

Additional context
QuickAdd version: 1.8.1

@Zebartin Zebartin added the bug Something isn't working label Apr 20, 2024
@Zebartin
Copy link
Author

It works after setting model to {name: "xxxxx"}

It seems that the example shown in document is not correct according to the source code:

`Model '${model.name}' not found in any provider`

@erauner12
Copy link

It works after setting model to {name: "xxxxx"}

It seems that the example shown in document is not correct according to the source code:

`Model '${model.name}' not found in any provider`

worked for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants