PARACOSM AGENTOS | API Reference v0.9.1035
Home Simulation API Docs GitHub npm
Home Simulation API Docs GitHub npm AgentOS Discord
paracosm - v0.9.1035
    Preparing search index...

    Type Alias GenerateTextFn

    GenerateTextFn: (
        promptOrOptions:
            | string
            | {
                maxTokens?: number;
                prompt: string;
                system?: { cacheBreakpoint?: boolean; text: string }[];
            },
    ) => Promise<string>

    Function signature for LLM text generation calls used by compile hooks.

    Supports two call shapes:

    • Legacy: pass a raw prompt string (no caching)
    • Cache-aware: pass { system, prompt } to route the stable prefix through cacheBreakpoint-tagged system blocks

    Wrappers in llm-invocations/ always use the cache-aware form; direct callers (CLI scripts, tests) can still use the string form.

    Type Declaration

      • (
            promptOrOptions:
                | string
                | {
                    maxTokens?: number;
                    prompt: string;
                    system?: { cacheBreakpoint?: boolean; text: string }[];
                },
        ): Promise<string>
      • Parameters

        • promptOrOptions:
              | string
              | {
                  maxTokens?: number;
                  prompt: string;
                  system?: { cacheBreakpoint?: boolean; text: string }[];
              }
          • string
          • {
                maxTokens?: number;
                prompt: string;
                system?: { cacheBreakpoint?: boolean; text: string }[];
            }
            • OptionalmaxTokens?: number

              Upper bound on completion tokens for this call. Caps tail spend when a model misbehaves and yaps beyond the intended output size (provider defaults sit at 4-8k tokens). Use ~2× the typical response size so well-behaved calls finish naturally and only runaway generations hit the cap.

            • prompt: string
            • Optionalsystem?: { cacheBreakpoint?: boolean; text: string }[]

        Returns Promise<string>