Skip to content

Conversation

mocayo
Copy link
Collaborator

@mocayo mocayo commented Sep 11, 2025

PR Description: Feature - Prompt as a Service (PTaaS) Update

This PR introduces multiple enhancements and new features to the cozeloop-ai module and integrates a foundational example of Prompt as a Service (PTaaS). Key highlights of the updates include:


What's Changed:

1. Bump cozeloop-ai Version to 0.0.9

  • Updated the cozeloop-ai package version to 0.0.9 to reflect recent additions and fixes.

2. Prompt as a Service (PTaaS)

  • Added a foundational implementation for "Prompt as a Service".
  • This feature enables external services to utilize cozeloop-ai powered custom prompts as a service.

3. Unit Test Coverage Enhancements

  • Added unit tests for the cozeloop-ai module to improve test coverage and ensure reliability in future development.

4. Example Integration

  • Introduced an example use-case implementation for PTaaS to demonstrate its capabilities and provide developers a starting point.

5. Prompt Types Update

  • Enhanced and updated prompt types to offer more flexibility and support additional formats.

Commit Breakdown:

  • 4932d5b: feat(cozeloop-ai): bump to 0.0.9
    Incremented the version of the cozeloop-ai package in line with the new changes.

  • 9df5784: feat(example): add ptaas
    Added an example implementation to demonstrate PTaaS functionality.

  • 8726423: feat(cozeloop-ai): add uts
    Integrated new unit tests for key cozeloop-ai functionalities.

  • b08314e: feat(cozeloop-ai): prompt as a service
    Implemented the core "Prompt as a Service" feature to provide external services access to dynamically generated prompts.

  • e0f5614: feat(cozeloop-ai): update prompt types
    Updated and enhanced prompt type definitions for better flexibility and wider use-case coverage.


Checklist:

  • Bumped cozeloop-ai version to match updates.
  • Implemented Prompt as a Service (PTaaS).
  • Added example implementation for PTaaS.
  • Enhanced unit test coverage for robustness.
  • Updated prompt types for broader compatibility.

Copy link

codecov bot commented Sep 11, 2025

Codecov Report

❌ Patch coverage is 98.05825% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/cozeloop-ai/src/prompt/converter.ts 98.13% 2 Missing ⚠️
packages/cozeloop-ai/src/prompt/ptaas.ts 95.00% 2 Missing ⚠️
@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
+ Coverage   88.58%   90.57%   +1.98%     
==========================================
  Files          56       59       +3     
  Lines        3048     3245     +197     
  Branches      666      748      +82     
==========================================
+ Hits         2700     2939     +239     
+ Misses        348      306      -42     
Components Coverage Δ
@cozeloop/ai 94.06% <98.05%> (+2.62%) ⬆️
@cozeloop/langchain 82.76% <ø> (ø)
Files with missing lines Coverage Δ
packages/cozeloop-ai/src/api/api-client/utils.ts 88.39% <100.00%> (ø)
packages/cozeloop-ai/src/api/prompt/index.ts 100.00% <100.00%> (ø)
packages/cozeloop-ai/src/index.ts 100.00% <ø> (ø)
packages/cozeloop-ai/src/prompt/guard.ts 100.00% <100.00%> (ø)
packages/cozeloop-ai/src/prompt/hub.ts 97.64% <100.00%> (+49.41%) ⬆️
packages/cozeloop-ai/src/prompt/index.ts 100.00% <ø> (ø)
packages/cozeloop-ai/src/prompt/trace.ts 100.00% <100.00%> (ø)
packages/cozeloop-ai/src/prompt/utils.ts 91.61% <100.00%> (ø)
packages/cozeloop-ai/src/prompt/converter.ts 98.13% <98.13%> (ø)
packages/cozeloop-ai/src/prompt/ptaas.ts 95.00% <95.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mocayo mocayo enabled auto-merge (squash) September 11, 2025 07:49
} from './types';
import { isContentPartArr, isMessage, isMessageArr } from './guard';

export function toLoopToolCalls(toolCalls?: ToolCall[]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缺少显示返回类型

@mocayo mocayo merged commit 19aff6d into main Sep 11, 2025
12 checks passed
@mocayo mocayo deleted the feat/ptaas branch September 11, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants