Skip to content

Can ClaudeAgentOptions set temperature and top p? Because each question-and-answer session is uncertain and random, users feel that the system is not unstable. A sense of stability is very importantΒ #464

@smalltalkhyb

Description

@smalltalkhyb

This is how I use my code:


        options = ClaudeAgentOptions(
            cwd=project_root,
            system_prompt=system_prompt,
            setting_sources=["user", "project"],
            env={
                "ANTHROPIC_MODEL": settings.ANTHROPIC_MODEL,
                "ANTHROPIC_API_KEY": api_key_random,
                "ANTHROPIC_BASE_URL": settings.ANTHROPIC_BASE_URL,
                "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
                "ANTHROPIC_DEFAULT_HAIKU_MODEL": settings.ANTHROPIC_MODEL,
                "ANTHROPIC_SMALL_FAST_MODEL": settings.ANTHROPIC_MODEL,
                "API_TIMEOUT_MS": settings.API_TIMEOUT_MS
            },
            allowed_tools=allowed_tools,
            settings=claude_settings_path,
            sandbox={"enabled": False},
            permission_mode=permission_mode,
        )

However, there is no place in ClaudeAgentOptions where the temperature and top p can be set. Could you tell me where they can be set?

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions