Skip to content

Commit dfbe36d

Browse files
authored
remove support for header file (c/cpp) (#4)
- mcpp-community/OpenOrg#1 Signed-off-by: SPeak Shen <speakshen@163.com>
1 parent 54b4f94 commit dfbe36d

File tree

17 files changed

+12
-1539
lines changed

17 files changed

+12
-1539
lines changed

README.md

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
> Modern C++ LLM API client with openai-compatible support
44
55
[![C++23](https://img.shields.io/badge/C%2B%2B-23-blue.svg)](https://en.cppreference.com/w/cpp/23)
6-
[![C API](https://img.shields.io/badge/C_API-ok-green.svg)](https://en.cppreference.com/w/cpp/23)
76
[![Module](https://img.shields.io/badge/module-ok-green.svg)](https://en.cppreference.com/w/cpp/language/modules)
87
[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE)
98
[![OpenAI Compatible](https://img.shields.io/badge/OpenAI_API-Compatible-green.svg)](https://platform.openai.com/docs/api-reference)
@@ -20,13 +19,10 @@ Clean, type-safe LLM API client using C++23 modules. Fluent interface with zero-
2019
- **Auto-Save History** - Conversation history managed automatically
2120
- **Type-Safe Streaming** - Concept-constrained callbacks
2221
- **Fluent Interface** - Chainable methods
23-
- **C API** - Full C language support with OOP style
2422
- **Provider Agnostic** - OpenAI, Poe, and compatible endpoints
2523

2624
## Quick Start
2725

28-
### C++ API
29-
3026
```cpp
3127
import std;
3228
import mcpplibs.llmapi;
@@ -48,31 +44,6 @@ int main() {
4844
}
4945
```
5046

51-
### C API
52-
53-
```c
54-
#include <stdio.h>
55-
56-
#include "llmapi.h"
57-
58-
void stream_print(const char* s, size_t len, void* data) {
59-
printf("%.*s", (int)len, s);
60-
fflush(stdout);
61-
}
62-
63-
int main(void) {
64-
llmapi_client_t* c = llmapi_client_create(getenv("OPENAI_API_KEY"), LLMAPI_URL_POE);
65-
66-
c->set_model(c, "gpt-5");
67-
c->add_system_message(c, "You are a helpful assistant.");
68-
c->add_user_message(c, "In one sentence, introduce modern C++. 并给出中文翻译");
69-
c->request_stream(c, stream_print, NULL);
70-
71-
c->destroy(c);
72-
return 0;
73-
}
74-
```
75-
7647
### Models / Providers
7748

7849
```cpp
@@ -82,24 +53,23 @@ llmapi::Client client(apiKey, llmapi::URL::DeepSeek); // Deepseek
8253
llmapi::Client client(apiKey, "https://custom.com"); // Custom
8354
```
8455
85-
## 🛠️ Building
56+
## Building
8657
8758
```bash
8859
xmake # Build
8960
xmake run basic # Run example(after cofig OPENAI_API_KEY)
9061
```
9162

92-
## 📦 Use in Build Tools
63+
## Use in Build Tools
9364

9465
### xmake
9566

9667
```lua
9768
-- 0 - Add mcpplibs's index repos
98-
add_repositories("mcpplibs-index git@github.com:mcpplibs/mcpplibs-index.git")
69+
add_repositories("mcpplibs-index https://github.com/mcpplibs/llmapi.git")
9970

10071
-- 1 - Add the libraries and versions you need
101-
add_requires("llmapi 0.0.1")
102-
-- add_requires("llmapi 0.0.1", configs = { capi = true }) -- if use c api
72+
add_requires("llmapi 0.0.2")
10373
```
10474

10575
> More: [mcpplibs-index](https://github.com/mcpplibs/mcpplibs-index)
@@ -110,19 +80,6 @@ add_requires("llmapi 0.0.1")
11080
todo...
11181
```
11282

113-
## 📚 API Reference
114-
115-
**C++ Core Methods:**
116-
- `model(name)` - Set model
117-
- `user/system/assistant(content)` - Add messages
118-
- `request()` - Non-streaming (returns JSON)
119-
- `request(callback)` - Streaming
120-
- `getAnswer()` - Get last assistant reply
121-
- `getMessages()` - Get conversation history
122-
- `clear()` - Clear history
123-
124-
**C API:** All methods available via function pointers (`client->method(client, ...)`)
125-
12683
## 📄 License
12784

12885
Apache-2.0 - see [LICENSE](LICENSE)

README.zh.hant.md

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
> Modern C++ LLM API client with openai-compatible support
44
55
[![C++23](https://img.shields.io/badge/C%2B%2B-23-blue.svg)](https://en.cppreference.com/w/cpp/23)
6-
[![C API](https://img.shields.io/badge/C_API-ok-green.svg)](https://en.cppreference.com/w/cpp/23)
76
[![Module](https://img.shields.io/badge/module-ok-green.svg)](https://en.cppreference.com/w/cpp/language/modules)
87
[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE)
98
[![OpenAI Compatible](https://img.shields.io/badge/OpenAI_API-Compatible-green.svg)](https://platform.openai.com/docs/api-reference)
@@ -20,12 +19,10 @@
2019
- **自動儲存歷史** - 對話歷史自動管理
2120
- **型別安全串流** - 概念約束的回呼函式
2221
- **流式介面** - 可鏈式呼叫的方法
23-
- **C 語言 API** - 完整的 C 語言支援,物件導向風格
2422
- **提供商無關** - OpenAI、Poe 及相容端點
2523

2624
## 快速開始
2725

28-
### C++ API
2926

3027
```cpp
3128
import std;
@@ -48,31 +45,6 @@ int main() {
4845
}
4946
```
5047

51-
### C API
52-
53-
```c
54-
#include <stdio.h>
55-
56-
#include "llmapi.h"
57-
58-
void stream_print(const char* s, size_t len, void* data) {
59-
printf("%.*s", (int)len, s);
60-
fflush(stdout);
61-
}
62-
63-
int main(void) {
64-
llmapi_client_t* c = llmapi_client_create(getenv("OPENAI_API_KEY"), LLMAPI_URL_POE);
65-
66-
c->set_model(c, "gpt-5");
67-
c->add_system_message(c, "You are a helpful assistant.");
68-
c->add_user_message(c, "In one sentence, introduce modern C++. 並給出中文翻譯");
69-
c->request_stream(c, stream_print, NULL);
70-
71-
c->destroy(c);
72-
return 0;
73-
}
74-
```
75-
7648
### 模型 / 提供商
7749

7850
```cpp
@@ -95,11 +67,10 @@ xmake run basic # 執行範例(需先設定 OPENAI_API_KEY)
9567

9668
```lua
9769
-- 0 - 新增 mcpplibs 索引倉庫
98-
add_repositories("mcpplibs-index git@github.com:mcpplibs/mcpplibs-index.git")
70+
add_repositories("mcpplibs-index https://github.com/mcpplibs/llmapi.git")
9971

10072
-- 1 - 新增需要的函式庫和版本
101-
add_requires("llmapi 0.0.1")
102-
-- add_requires("llmapi 0.0.1", configs = { capi = true }) -- 如果使用 C API
73+
add_requires("llmapi 0.0.2")
10374
```
10475

10576
> More: [mcpplibs-index](https://github.com/mcpplibs/mcpplibs-index)
@@ -110,19 +81,6 @@ add_requires("llmapi 0.0.1")
11081
todo...
11182
```
11283

113-
## 📚 API 參考
114-
115-
**C++ 核心方法:**
116-
- `model(name)` - 設定模型
117-
- `user/system/assistant(content)` - 新增訊息
118-
- `request()` - 非串流(回傳 JSON)
119-
- `request(callback)` - 串流輸出
120-
- `getAnswer()` - 取得最後的助手回覆
121-
- `getMessages()` - 取得對話歷史
122-
- `clear()` - 清空歷史
123-
124-
**C API:** 所有方法透過函式指標存取 (`client->method(client, ...)`)
125-
12684
## 📄 授權條款
12785

12886
Apache-2.0 - 詳見 [LICENSE](LICENSE)

README.zh.md

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
> Modern C++ LLM API client with openai-compatible support
44
55
[![C++23](https://img.shields.io/badge/C%2B%2B-23-blue.svg)](https://en.cppreference.com/w/cpp/23)
6-
[![C API](https://img.shields.io/badge/C_API-ok-green.svg)](https://en.cppreference.com/w/cpp/23)
76
[![Module](https://img.shields.io/badge/module-ok-green.svg)](https://en.cppreference.com/w/cpp/language/modules)
87
[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE)
98
[![OpenAI Compatible](https://img.shields.io/badge/OpenAI_API-Compatible-green.svg)](https://platform.openai.com/docs/api-reference)
@@ -20,13 +19,10 @@
2019
- **自动保存历史** - 对话历史自动管理
2120
- **类型安全流式** - 概念约束的回调函数
2221
- **流式接口** - 可链式调用的方法
23-
- **C 语言 API** - 完整的 C 语言支持,面向对象风格
2422
- **提供商无关** - OpenAI、Poe 及兼容端点
2523

2624
## 快速开始
2725

28-
### C++ API
29-
3026
```cpp
3127
import std;
3228
import mcpplibs.llmapi;
@@ -48,31 +44,6 @@ int main() {
4844
}
4945
```
5046

51-
### C API
52-
53-
```c
54-
#include <stdio.h>
55-
56-
#include "llmapi.h"
57-
58-
void stream_print(const char* s, size_t len, void* data) {
59-
printf("%.*s", (int)len, s);
60-
fflush(stdout);
61-
}
62-
63-
int main(void) {
64-
llmapi_client_t* c = llmapi_client_create(getenv("OPENAI_API_KEY"), LLMAPI_URL_POE);
65-
66-
c->set_model(c, "gpt-5");
67-
c->add_system_message(c, "You are a helpful assistant.");
68-
c->add_user_message(c, "In one sentence, introduce modern C++. 并给出中文翻译");
69-
c->request_stream(c, stream_print, NULL);
70-
71-
c->destroy(c);
72-
return 0;
73-
}
74-
```
75-
7647
### 模型 / 提供商
7748

7849
```cpp
@@ -82,24 +53,23 @@ llmapi::Client client(apiKey, llmapi::URL::DeepSeek); // Deepseek
8253
llmapi::Client client(apiKey, "https://custom.com"); // 自定义
8354
```
8455
85-
## 🛠️ 构建
56+
## 构建
8657
8758
```bash
8859
xmake # 构建
8960
xmake run basic # 运行示例(需要先配置 OPENAI_API_KEY)
9061
```
9162

92-
## 📦 在构建工具中使用
63+
## 在构建工具中使用
9364

9465
### xmake
9566

9667
```lua
9768
-- 0 - 添加 mcpplibs 索引仓库
98-
add_repositories("mcpplibs-index git@github.com:mcpplibs/mcpplibs-index.git")
69+
add_repositories("mcpplibs-index https://github.com/mcpplibs/llmapi.git")
9970

10071
-- 1 - 添加需要的库和版本
101-
add_requires("llmapi 0.0.1")
102-
-- add_requires("llmapi 0.0.1", configs = { capi = true }) -- 如果使用 C API
72+
add_requires("llmapi 0.0.2")
10373
```
10474

10575
> More: [mcpplibs-index](https://github.com/mcpplibs/mcpplibs-index)
@@ -110,19 +80,6 @@ add_requires("llmapi 0.0.1")
11080
todo...
11181
```
11282

113-
## 📚 API 参考
114-
115-
**C++ 核心方法:**
116-
- `model(name)` - 设置模型
117-
- `user/system/assistant(content)` - 添加消息
118-
- `request()` - 非流式(返回 JSON)
119-
- `request(callback)` - 流式输出
120-
- `getAnswer()` - 获取最后的助手回复
121-
- `getMessages()` - 获取对话历史
122-
- `clear()` - 清空历史
123-
124-
**C API:** 所有方法通过函数指针访问 (`client->method(client, ...)`)
125-
12683
## 📄 许可证
12784

12885
Apache-2.0 - 详见 [LICENSE](LICENSE)

docs/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Complete documentation for the llmapi library - a modern C++ LLM API client.
66

77
- [Getting Started](getting-started.md) - Installation and first steps
88
- [C++ API Guide](cpp-api.md) - Complete C++ API reference
9-
- [C API Guide](c-api.md) - Complete C API reference
109
- [Examples](examples.md) - Code examples and use cases
1110
- [Providers](providers.md) - Supported LLM providers
1211
- [Advanced Usage](advanced.md) - Advanced features and patterns
@@ -18,18 +17,12 @@ Complete documentation for the llmapi library - a modern C++ LLM API client.
1817
- See [C++ API Guide](cpp-api.md) for full API reference
1918
- Check [Examples](examples.md) for common patterns
2019

21-
**For C Developers:**
22-
- Start with [Getting Started](getting-started.md)
23-
- See [C API Guide](c-api.md) for full API reference
24-
- Check [Examples](examples.md) for C examples
25-
2620
## Features Overview
2721

2822
- **C++23 Modules** - Modern module system
2923
- **Auto-Save History** - Automatic conversation management
3024
- **Type-Safe Streaming** - Concept-constrained callbacks
3125
- **Fluent Interface** - Chainable API design
32-
- **C API Support** - Full C language bindings
3326
- **Provider Agnostic** - OpenAI, Poe, and custom endpoints
3427

3528
## License

0 commit comments

Comments
 (0)