Skip to content

Commit efb6ba3

Browse files
committed
refactor(Claude): 修复bug
1 parent 7b11dd7 commit efb6ba3

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

include/Configure.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,7 @@ namespace YAML
907907
data.authKeys.push_back(key.as<std::string>());
908908
}
909909
}
910+
return true;
910911
}
911912
};
912913
}

include/Impls/Claude_Impl.h

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,30 @@ class ClaudeInSlack : public ChatBot
1010
{
1111
}
1212

13-
std::string Submit(std::string prompt, size_t timeStamp, std::string role,
14-
std::string convid, float temp,
15-
float top_p ,
16-
uint32_t top_k,
17-
float pres_pen ,
18-
float freq_pen , bool async = false)override;
13+
std::string Submit(std::string prompt, size_t timeStamp, std::string role = Role::User,
14+
std::string convid = "default", float temp = 0.7f,
15+
float top_p = 0.9f,
16+
uint32_t top_k = 40u,
17+
float pres_pen = 0.0f,
18+
float freq_pen = 0.0f, bool async = false) override;
1919

2020
void Reset() override;;
2121

22-
void Load(std::string ) override;
22+
void Load(std::string name) override;
2323

24-
void Save(std::string ) override;
24+
void Save(std::string name) override;
2525

2626
void Del(std::string id) override;
2727

2828
void Add(std::string name) override;
2929

3030
map<long long, string> GetHistory() override;
31+
3132
std::string sendRequest(std::string data, size_t ts) override
3233
{
3334
return "";
3435
}
36+
3537
std::string GetModel() override
3638
{
3739
return "Claude";
@@ -53,12 +55,12 @@ class Claude : public ChatBot
5355
Claude(const ClaudeAPICreateInfo& claude_data, std::string systemrole = "");
5456

5557
// 提交用户消息并获取响应
56-
std::string Submit(std::string prompt, size_t timeStamp, std::string role ,
57-
std::string convid, float temp,
58-
float top_p ,
59-
uint32_t top_k ,
60-
float pres_pen,
61-
float freq_pen , bool async)override;
58+
std::string Submit(std::string prompt, size_t timeStamp, std::string role = Role::User,
59+
std::string convid = "default", float temp = 0.7f,
60+
float top_p = 0.9f,
61+
uint32_t top_k = 40u,
62+
float pres_pen = 0.0f,
63+
float freq_pen = 0.0f, bool async = false) override;
6264

6365
// 重置当前对话
6466
void Reset() override;
@@ -108,6 +110,7 @@ class Claude : public ChatBot
108110

109111
public:
110112
void BuildHistory(const std::vector<std::pair<std::string, std::string>>& history) override;
113+
111114
std::string GetModel() override
112115
{
113116
return claude_data_.model;

0 commit comments

Comments
 (0)