Skip to content

Commit c747bdc

Browse files
committed
Merge branch 'development'
2 parents 03330b9 + 8a32d6a commit c747bdc

31 files changed

+511
-754
lines changed

.github/workflows/macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16-
- name: Install and autoconf
16+
- name: Install autoconf and llama.cpp
1717
run: |
18-
brew install autoconf
18+
brew install autoconf llama.cpp
1919
2020
- name: Configure CMake & Build
2121
run: cmake -B build && cmake --build build --config Release

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ build
4747
cmake-build-debug
4848
.vscode
4949
.cache
50-
.env
50+
.env
51+
tests/research/qwen2.5-3b-instruct-q2_k.gguf

include/camille-agenty/agents/agent-context.h

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,28 @@
11
#ifndef AGENT_CONTEXT_H_
22
#define AGENT_CONTEXT_H_
33

4-
#include <filesystem>
5-
#include <thread>
6-
#include <vector>
7-
8-
#include "camille-agenty/agents/agent.h"
9-
#include "camille-agenty/common/http-client.h"
104
#include "camille-agenty/common/json-parser.h"
11-
#include "camille-agenty/providers/provider.h"
5+
#include "camille-agenty/common/http-client.h"
126

137
namespace agenty::agent {
148

15-
struct cloud_ctx {
16-
common::json_parse* j_parser;
17-
};
9+
enum class roles : uint8_t { ASSISTANT, SYSTEM, USER, TOOL };
1810

19-
struct llama_ctx {
20-
common::json_parse* j_parser;
11+
struct message {
12+
roles role;
13+
std::string content;
2114
};
2215

23-
class context {
24-
public:
25-
explicit context(std::string url);
16+
enum class backend_type : uint8_t { CLOUD, LLAMA };
2617

27-
void pack_payload(); // form a json or some sort
28-
29-
void run(const std::shared_ptr<provider::provider>& provider, agent_type type);
30-
void run_stream();
31-
void run_batch();
32-
void run_with_files(std::vector<std::filesystem::path> paths);
33-
34-
void decode_msg();
35-
36-
private:
37-
std::string url_;
38-
std::thread thread_;
39-
std::unordered_map<int, int> cache_; // change from int
40-
};
18+
// simple apis for how to handle the logic and responses, if cloud we use http, json.. how we
19+
// construct the messages..
20+
// in llama we use custom structuring, no json, structured outputs..
21+
class cloud_context {}; // holds all the json args, operations for cloud via http, will also take
22+
// care of deconstructing the model struct with the hyper params, init here
23+
// the httplib client with ssl and everything
24+
class llama_context {
25+
}; // no need for json, therefore llama_context, takes also care of the model struct
4126

4227
} // namespace agenty::agent
4328

include/camille-agenty/agents/agent-graph.h

Lines changed: 0 additions & 10 deletions
This file was deleted.

include/camille-agenty/agents/agent-memory.h

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
#ifndef AGENT_MEMORY_H_
22
#define AGENT_MEMORY_H_
33

4+
#include <string>
5+
6+
#include "camille-agenty/agents/agent-context.h"
7+
48
namespace agenty::agent {
59

6-
/**
7-
* TODO:
8-
* custom cache
9-
* init agent-graph here (state graph).
10-
* init here the orchestration.
11-
*/
10+
struct memory_config {
11+
int max_connections;
12+
bool external{false};
13+
std::string connection_string;
14+
// alot of work here, but building the structure for the future.
15+
};
16+
17+
class memory {
18+
public:
19+
explicit memory(
20+
backend_type type); // if llama, we create kv context memory also, in general we create a
21+
// common, with options to add db or vector db engine.
22+
explicit memory(memory_config config);
1223

13-
class memory {};
24+
private:
25+
std::vector<std::string> common_memory; // if external is false we use this, if true we dont
26+
};
1427

1528
} // namespace agenty::agent
1629

include/camille-agenty/agents/agent-tools.h

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,22 @@
55
#include <memory>
66
#include <functional>
77

8+
#include "json.hpp"
9+
10+
using json = nlohmann::json;
11+
812
namespace agenty::agent {
913

1014
struct tool_params {
1115
uint8_t max_retries;
1216
};
1317

14-
enum class types : uint8_t { TOOL_TYPE_STRING, TOOL_TYPE_BYTES };
15-
16-
class base_tool {
17-
public:
18-
virtual ~base_tool() = default;
19-
};
20-
21-
struct tool : public base_tool {
22-
types tool_type; // the type of data that the tool accepts
18+
struct tool {
2319
tool_params params;
2420
std::string tool_name;
21+
std::string tool_schema;
2522
std::string tool_description;
26-
std::function<void()> tool;
27-
};
28-
29-
class custom_tool {
30-
public:
31-
explicit custom_tool(std::function<void()> func);
32-
custom_tool(const custom_tool& custom_tool);
33-
custom_tool(custom_tool&& custom_tool) noexcept;
34-
35-
private:
36-
std::unique_ptr<tool> tool_;
23+
json tool_schema_json;
3724
};
3825

3926
} // namespace agenty::agent

0 commit comments

Comments
 (0)