Skip to content

Commit a6904f5

Browse files
committed
runtime methods init
1 parent e0f34a1 commit a6904f5

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

include/camille-agenty/clients/qwen-client.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define QWEN_CLIENT_H_
33

44
#include "camille-agenty/common/config.h"
5+
#include "camille-agenty/common/agenty.h"
56
#include "camille-agenty/agents/agent.h"
67
#include "camille-agenty/clients/client.h"
78
#include "camille-agenty/agents/agent-context.h"

include/camille-agenty/common/agenty.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace agenty::common::agenty {
1010
/**
1111
* TODO:
1212
*/
13-
void init_agenty(); // on main startup, init here the task and parser according to agent type ptr.
13+
void init_agenty(); // on main startup, init here the context and parser according to agent type
14+
// ptr.
1415
void init_llama_backend(); // on llama_client and llama server
1516
void init_agent_backend(); // on cloud
1617

src/clients/qwen-client.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@
33
namespace agenty::client {
44

55
qwen_client::qwen_client(const std::string& model_name, agent::agent_type type) {
6+
common::agenty::init_agenty();
67
model::model model;
78
model.model_name = model_name;
9+
810
switch (type) {
911
case agent::agent_type::CLOUD_AGENT:
1012
model.model_type = model::model_type::CLOUD_MODEL_TYPE;
1113
agent_ = std::make_unique<agent::cloud_agent>();
14+
common::agenty::init_agent_backend();
15+
1216
case agent::agent_type::LLAMA_AGENT:
1317
model.model_type = model::model_type::LLAMA_MODEL_TYPE;
1418
agent_ = std::make_unique<agent::llama_agent>();
19+
common::agenty::init_llama_backend();
1520
}
1621
model::init_hyper_params(std::nullopt, model);
1722

src/common/agenty.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "camille-agenty/common/agenty.h"
2+
#include "camille-agenty/agents/agent-context.h"
3+
#include <memory>
4+
5+
namespace agenty::common::agenty {
6+
7+
void init_agenty() { std::shared_ptr<agent::context> ctx = std::make_shared<agent::context>(); }
8+
9+
} // namespace agenty::common::agenty

0 commit comments

Comments
 (0)