Mmidwinter1993update docs
a22a2ce5创建于 2025年10月17日历史提交

Package config

class Config

prop agentLogDir

static var agentLogDir = "./logs/agent-logs"
  • Description: The directory used to save agent logs.

prop codeInterpreterDir

static var codeInterpreterDir = "./logs/code-interpreter-scripts"
  • Description: The directory used to save scripts generated by code interpreter tools.

prop defaultChatModel

static var defaultChatModel = Option<ChatModel>.None
  • Description: The default chat model.

prop defaultContextLen

static var defaultContextLen = 32000
  • Description: The default context length.

prop defaultEmbeddingModel

static var defaultEmbeddingModel = Option<EmbeddingModel>.None
  • Description: The default embedding model.

prop defaultTokenizer

static var defaultTokenizer = Option<Tokenizer>.None
  • Description: The default tokenizer.

prop enableAgentLog

static var enableAgentLog = false
  • Description: Whether to enable agent log. If enabled, agent logs will be saved to separate files.

prop enableJsonRepair

static var enableJsonRepair = true
  • Description: Whether to enable JSON repair when the model response is not valid JSON.

prop enableModelToolCall

static var enableModelToolCall = false
  • Description: Whether to use the tool call feature of LLMs.

prop enableParallelToolCall

static var enableParallelToolCall = true
  • Description: Whether to enable parallel tool call feature of LLMs.

prop enableToolCallCheck

static var enableToolCallCheck = false
  • Description: Whether to enable tool call check, like checking repeated tool calls.

prop env

static let env = EnvWrapper()
  • Description: Provides a way to easily get/set environment variables.

prop httpConnectTimeout

static var httpConnectTimeout = 60000
  • Description: The max connection timeout in HTTP requests (ms).

prop httpReadWriteTimeout

static var httpReadWriteTimeout = 60000
  • Description: The max read/write timeout in HTTP requests (ms).

prop importPaths

static var importPaths = ["."]
  • Description: Import paths for file import functionality. Used to resolve @ references in agent requests.

prop logFile

static var logFile: String = "stderr"
  • Description: The file used to save logs. If set to "stderr", logs will be printed to standard error.

prop logLevel

static mut prop logLevel: String
  • Description: Gets or sets the log level. Available values: "error", "info", "debug", "trace".

prop maxReactNumber

static var maxReactNumber = 10
  • Description: The max number of react execution steps.

prop modelRequestDir

static var modelRequestDir = "./logs/model-requests"
  • Description: The directory used to save model requests.

prop modelRetryNumber

static var modelRetryNumber = 3
  • Description: The max retry number when failing to get valid LLM responses.

prop outputRepairRetryNumber

static var outputRepairRetryNumber = 3
  • Description: The max retry number when failing to generate outputs of required JSON schema.

prop resourceDir

static mut prop resourceDir: String
  • Description: Gets or sets the resource directory.

prop saveCodeInterpreter

static var saveCodeInterpreter = false
  • Description: Whether to save code interpreter scripts generated by code interpreter tools.

prop saveModelRequest

static var saveModelRequest = false
  • Description: Whether to save model requests.

prop toolResultCompactThreshold

static var toolResultCompactThreshold = 1500
  • Description: The threshold to decide whether to summarize the tool result when the tool enables summarization.

struct EnvWrapper

func load

func load(path: Path): String
  • Description: Loads environment variables from a .env file.
  • Parameters:
    • path: Path, The path to the .env file to load.

func operator operator []

operator func [](name: String, value!: String): Unit
  • Description: Sets the environment variable with the specified name to the given value.
  • Parameters:
    • name: String, The name of the environment variable to set.
    • value: String, The value to set the environment variable to.

func operator operator []

operator func [](name: String): Option<String>
  • Description: Gets the environment variable with the specified name.
  • Parameters:
    • name: String, The name of the environment variable to get.