这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@timothycarambat
Copy link
Member

No description provided.

@timothycarambat timothycarambat merged commit 6957bc3 into master Nov 13, 2023
@timothycarambat timothycarambat deleted the robots.txt branch November 13, 2023 23:22
@review-agent-prime
Copy link

server/index.js

It's a good practice to use a static file for robots.txt instead of generating it dynamically for each request. This will reduce the load on the server.
Create Issue

    app.use(express.static(path.join(__dirname, 'public')));

server/utils/AiProviders/anthropic/index.js

It's a good practice to define default values at the top of the file or in a configuration file. This makes it easier to find and change these values.
Create Issue

    const DEFAULT_MODEL = "claude-2";
    this.model = process.env.ANTHROPIC_MODEL_PREF || DEFAULT_MODEL;

server/utils/AiProviders/lmStudio/index.js

The variable 'model' is not defined in the current scope. It seems like you wanted to reference 'this.model' instead.
Create Issue

    throw new Error(`LMStudio chat: ${this.model} is not valid or defined for chat completion!`);

server/utils/AiProviders/openAi/index.js

It's a good practice to define default values at the top of the file or in a configuration file. This makes it easier to find and change these values.
Create Issue

    const DEFAULT_MODEL = "gpt-3.5-turbo";
    this.model = process.env.OPEN_MODEL_PREF || DEFAULT_MODEL;

There's no need to check if the model is valid for chat completion twice. You can store the result in a variable and use it in the if statement and the error message.
Create Issue

    const isValidModel = await this.isValidChatCompletionModel(this.model);
    if (!isValidModel)
      throw new Error(`OpenAI chat: ${this.model} is not valid for chat completion!`);

cabwds pushed a commit to cabwds/anything-llm that referenced this pull request Jul 3, 2025
* assume default model where appropriate

* merge with master and fix other model refs

* disallow robots

* add public file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants