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
19 changes: 11 additions & 8 deletions packages/cozeloop-ai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# 🕗 ChangeLog - @cozeloop/ai

## 0.1.0
* [fix] jsonwebtoken cjs in esm

## 0.0.9
* Prompt as a Service (ptaas)
* [feat] Prompt as a Service (ptaas)

## 0.0.8
* PromptHub: get prompt with label
* [feat] PromptHub: get prompt with label

## 0.0.7
* PromptHub: multi-modal variable in template
* [feat] PromptHub: multi-modal variable in template

## 0.0.6
* PromptHub: support prompt with Jinja2 template type
* [feat] PromptHub: support prompt with Jinja2 template type

## 0.0.5
* fix: variable_defs may be undefined (by @othorizon)
* [fix] variable_defs may be undefined (by @othorizon)

## 0.0.1 ~ 0.0.4
🌱 Early version

- PromptHub: pull and format prompts from [CozeLoop](https://loop.coze.cn)
- Auth: support OAuth JWT flow
- Trace with cozeLoopTracer
- [feat] PromptHub: pull and format prompts from [CozeLoop](https://loop.coze.cn)
- [feat] Auth: support OAuth JWT flow
- [feat] Trace with cozeLoopTracer
- initialize: init trace report
- traceable: high-level function that warps any function
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.9",
"version": "0.0.10",
"description": "Official Node.js SDK of CozeLoop | 扣子罗盘官方 Node.js SDK",
"keywords": [
"cozeloop",
Expand Down
5 changes: 3 additions & 2 deletions packages/cozeloop-ai/src/auth/oauth-jwt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
// SPDX-License-Identifier: MIT
import { sign as signJWT, type Algorithm } from 'jsonwebtoken';
import { type Algorithm } from 'jsonwebtoken';
import jwt from 'jsonwebtoken';

import { type SetRequired } from '../utils/types';
import { type SimpleLogger } from '../utils/logger';
Expand Down Expand Up @@ -152,7 +153,7 @@ export class OAuthJWTFlow extends OAuthBaseFlow {
payload.session_name = sessionName;
}

return signJWT(payload, privateKey, { algorithm, keyid });
return jwt.sign(payload, privateKey, { algorithm, keyid });
}

async getToken(req?: OAuthJWTFlowGetTokenReq) {
Expand Down
Loading