Skip to content

Conversation

@vapi-tasker
Copy link

@vapi-tasker vapi-tasker bot commented Jan 31, 2026

Summary

This PR updates the server-sdk-typescript SDK to align with the latest OpenAI API specification, addressing gaps identified in the API audit (VAP-11729).

Changes Made

  • Added developer role to OpenAiMessageRole enum (HIGH priority): Required for GPT-5.x and o-series models. The developer role provides system-level instructions that take precedence over user messages.

  • Added deprecation notice for function role (LOW priority): The function role is deprecated in favor of tool. Added JSDoc deprecation annotations to guide users toward the recommended approach.

  • Added optional API parameters to OpenAiModel (MEDIUM priority):

    • seed - For deterministic sampling
    • topP - Nucleus sampling parameter (alternative to temperature)
    • frequencyPenalty - Penalize repeated tokens (-2.0 to 2.0)
    • presencePenalty - Encourage new topics (-2.0 to 2.0)
    • logprobs - Return log probabilities of output tokens
    • topLogprobs - Number of top log probabilities to return (0-20)
    • parallelToolCalls - Enable parallel function calling
    • reasoningEffort - Control reasoning depth for o1/o3 reasoning models (low/medium/high)
  • Added OpenAiModelReasoningEffort type: New enum type with low, medium, and high options for controlling reasoning effort.

Test Plan

  • Added unit tests for OpenAiMessageRole with developer role
  • Added unit tests for OpenAiModelReasoningEffort enum values
  • Added unit tests for OpenAiModel with all new parameters
  • Added backward compatibility tests
  • All 359 tests pass
  • Build passes (CJS and ESM)
  • Lint passes
  • Format check passes

Backward Compatibility

All changes are fully backward compatible:

  • Existing role values unchanged
  • All new parameters are optional
  • No breaking changes to existing interfaces

Files Changed

  • src/api/types/OpenAiMessageRole.ts - Added developer role and deprecation notice
  • src/api/types/OpenAiModel.ts - Added new optional parameters
  • src/api/types/OpenAiModelReasoningEffort.ts - New type file
  • src/api/types/index.ts - Export new type
  • tests/unit/types/ - New comprehensive test files
  • .fernignore - Preserve test files from Fern regeneration

Related Issues

VAP-11729


Generated with Claude Code

VAP-11729

- Add 'developer' role to OpenAiMessageRole enum for GPT-5.x and o-series models
- Add deprecation notice for 'function' role in favor of 'tool'
- Add new optional API parameters to OpenAiModel interface:
  - seed: for deterministic sampling
  - topP: nucleus sampling parameter
  - frequencyPenalty: penalize repeated tokens
  - presencePenalty: encourage new topics
  - logprobs: return token log probabilities
  - topLogprobs: number of top log probabilities to return
  - parallelToolCalls: enable parallel function calling
  - reasoningEffort: control reasoning depth for o1/o3 models
- Add OpenAiModelReasoningEffort type with low/medium/high options
- Add comprehensive unit tests for all changes

All changes are backward compatible and follow existing code patterns.

Co-Authored-By: Claude <[email protected]>
@vapi-tasker vapi-tasker bot requested a review from roshan-vapi January 31, 2026 07:44
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.

0 participants