🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
LLMConfig.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstUtil/JsonValue.hpp"
25#include <string>
26
27AST_NAMESPACE_BEGIN
28
34class JsonValue;
35
38class AST_AI_API LLMConfig
39{
40public:
41 LLMConfig() = default;
42 ~LLMConfig() = default;
43
45 void setModel(const std::string& model) { model_ = model; }
47 const std::string& model() const { return model_; }
48
50 void setTemperature(float temperature) { temperature_ = temperature; }
52 float temperature() const { return temperature_; }
53
55 void setExtraBody(const JsonValue& extra) { extraBody_ = extra; }
57 const JsonValue& extraBody() const { return extraBody_; }
58
59private:
60 std::string model_ = "deepseek-v4-flash";
61 float temperature_ = 0.2f;
62 JsonValue extraBody_;
63};
64
67AST_NAMESPACE_END
JSON 值类
定义 JsonValue.hpp:47
LLM请求配置
定义 LLMConfig.hpp:39
const std::string & model() const
获取模型名称
定义 LLMConfig.hpp:47
void setModel(const std::string &model)
设置模型名称
定义 LLMConfig.hpp:45
void setTemperature(float temperature)
设置温度参数
定义 LLMConfig.hpp:50
void setExtraBody(const JsonValue &extra)
设置提供者特有的额外请求体字段(如DeepSeek的thinking)
定义 LLMConfig.hpp:55
float temperature() const
获取温度参数
定义 LLMConfig.hpp:52
const JsonValue & extraBody() const
获取提供者特有的额外请求体字段
定义 LLMConfig.hpp:57