Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@
"dictionaryDefinitions": [],
"dictionaries": [],
"caseSensitive": false,
"words": ["packagejson", "preinstall", "websockets"],
"words": [
"autoinstallers",
"Bytedance",
"cozeloop",
"Langsmith",
"packagejson",
"preinstall",
"traceparent",
"tracestate",
"vikingdb",
"websockets"
],
"ignoreWords": [],
"import": []
}
6 changes: 3 additions & 3 deletions packages/cozeloop-ai/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CozeLoop SDK
# 🧭 CozeLoop SDK

[![npm version](https://img.shields.io/npm/v/%40cozeloop%2Fai)](https://www.npmjs.com/package/@cozeloop/ai)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Expand Down Expand Up @@ -41,7 +41,7 @@ const prompt = await promptHub.getPrompt(
```

## Key Features
- 🗄️ **Prompt Hub**: Develop, submit and publish prompts on [CozeLoop](https://coze.loop.cn), and access them it via `PromptHub`
- 🗄️ **Prompt Hub**: Develop, submit and publish prompts on [CozeLoop](https://loop.coze.cn), and access them it via `PromptHub`
- 🔐 **Authentication Methods**: PAT and JWT
- ⚙️ **Configurable**: Timeout, headers, signal, debug options

Expand All @@ -62,7 +62,7 @@ const authFlow = new OAuthJWTFlow({
appId: '1177045121217', // Auth App Id
aud: 'api.coze.cn', // just use api.coze.cn
keyid: 'public_key_id of Auth App',
privateKey: 'priveate_key_content',
privateKey: 'private_key_content',
});

const tokenResp = await authFlow.getToken();
Expand Down
6 changes: 3 additions & 3 deletions packages/cozeloop-ai/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CozeLoop SDK
# 🧭 扣子罗盘 SDK

[![npm version](https://img.shields.io/npm/v/%40cozeloop%2Fai)](https://www.npmjs.com/package/@cozeloop/ai)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Expand Down Expand Up @@ -41,7 +41,7 @@ const prompt = await promptHub.getPrompt(
```

## 主要特性
- 🗄️ **Prompt Hub**: 在 [CozeLoop](https://coze.loop.cn) 平台开发、提交和发布 Prompt,使用 `PromptHub` 访问 Prompt。
- 🗄️ **Prompt Hub**: 在 [CozeLoop](https://loop.coze.cn) 平台开发、提交和发布 Prompt,使用 `PromptHub` 访问 Prompt。
- 🔐 **多种鉴权方式**: PAT and JWT
- ⚙️ **可配置**: 超时、请求头、信号、调试

Expand All @@ -62,7 +62,7 @@ const authFlow = new OAuthJWTFlow({
appId: '1177045121217', // 授权应用 App Id
aud: 'api.coze.cn', // 使用 api.coze.cn
keyid: 'public_key_id of Auth App',
privateKey: 'priveate_key_content',
privateKey: 'private_key_content',
});

const tokenResp = await authFlow.getToken();
Expand Down
2 changes: 1 addition & 1 deletion packages/cozeloop-ai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cozeloop/ai",
"version": "0.0.4-beta.4",
"version": "0.0.4",
"description": "Official Node.js SDK of CozeLoop | 扣子罗盘官方 Node.js SDK",
"keywords": [
"cozeloop",
Expand Down
3 changes: 3 additions & 0 deletions packages/cozeloop-ai/src/tracer/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export const ROOT_SPAN_PARENT_ID = '0';

export const COZELOOP_LOGGER_TRACER_TAG = 'Tracer';

/** Default export batch size 100 (according to the server) */
export const COZELOOP_MAX_EXPORT_BATCH_SIZE = 100;

export enum COZELOOP_TRACE_IDENTIFIER {
LOOP = 'cozeloop-js',
}
Expand Down
5 changes: 4 additions & 1 deletion packages/cozeloop-ai/src/tracer/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { type LoopTraceInitializeOptions } from './types';
import { CozeLoopTraceExporter } from './exporter';
import {
COZELOOP_LOGGER_TRACER_TAG,
COZELOOP_MAX_EXPORT_BATCH_SIZE,
COZELOOP_TRACE_OPTIONS,
} from './constants';

Expand All @@ -27,7 +28,9 @@ function instantiateProcessor(
switch (processor) {
case 'batch':
case undefined:
return new BatchSpanProcessor(exporter);
return new BatchSpanProcessor(exporter, {
maxExportBatchSize: COZELOOP_MAX_EXPORT_BATCH_SIZE,
});
case 'noop':
return new NoopSpanProcessor();
case 'simple':
Expand Down