Skip to content

Commit 3fa470d

Browse files
Merge pull request #6 from Conceptual-Machines/fix/anthropic-no-temperature
Anthropic: honor noTemperature (0.2.1)
2 parents e8e9f8c + fce149d commit 3fa470d

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.22)
2-
project(juce_llm VERSION 0.2.0 LANGUAGES CXX)
2+
project(juce_llm VERSION 0.2.1 LANGUAGES CXX)
33

44
set(CMAKE_CXX_STANDARD 20)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)

juce_llm/juce_llm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
ID: juce_llm
55
vendor: Conceptual Machines
6-
version: 0.2.0
6+
version: 0.2.1
77
name: LLM Client
88
description: Unified LLM API client for JUCE — text generation and structured
99
output across OpenAI, Anthropic, Gemini, OpenRouter, and llama-server.

juce_llm/llm/providers/AnthropicClient.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ juce::String AnthropicClient::buildRequestBody(const Request& request) const {
2121
int maxTok = request.maxTokens > 0 ? request.maxTokens
2222
: (config_.maxTokens > 0 ? config_.maxTokens : 4096);
2323
payload->setProperty("max_tokens", maxTok);
24-
payload->setProperty("temperature", (double)request.temperature);
24+
// Some newer models (e.g. Claude Opus 4.8) deprecated the temperature
25+
// parameter and reject the request if it's present.
26+
if (!config_.noTemperature)
27+
payload->setProperty("temperature", (double)request.temperature);
2528
payload->setProperty("messages", messagesArray);
2629

2730
// System prompt with prompt caching — cache the system prompt block

0 commit comments

Comments
 (0)