ADK for TypeScript: API Reference
    Preparing search index...

    Function loadDotenvForAgent

    • Walks up from the agent directory to the root directory and loads the first .env file found into process.env with override semantics.

      When agentParentFolder is given, agentName must be a single path segment that resolves inside it. When agentParentFolder is omitted, agentName may be a path, but it must not be . or contain a .. segment. These checks are lexical: they do not follow symlinks.

      Parameters

      • agentName: string

        The name of the agent, or a path to it when agentParentFolder is omitted.

      • OptionalagentParentFolder: string

        The directory that contains the agent. Optional.

      • filename: string = '.env'

        The dotenv file name to search for. Must be a single path segment. Defaults to '.env'.

      Returns void

      If agentName, agentParentFolder or filename is invalid, or if agentName resolves outside agentParentFolder.