@oh-my-pi/pi-ai 13.1.2 → 13.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [13.2.0] - 2026-02-23
6
+
7
+ ### Added
8
+
9
+ - Added support for GitHub Copilot provider in strict mode for both openai-completions and openai-responses tool schemas
10
+
11
+ ### Fixed
12
+
13
+ - Fixed tool descriptions being rejected when undefined by providing empty string fallback across all providers
14
+
5
15
  ## [12.19.1] - 2026-02-22
6
16
  ### Added
7
17
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-ai",
4
- "version": "13.1.2",
4
+ "version": "13.2.0",
5
5
  "description": "Unified LLM API with automatic model discovery and provider configuration",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
@@ -44,7 +44,7 @@
44
44
  "@connectrpc/connect-node": "^2.1",
45
45
  "@google/genai": "^1.42",
46
46
  "@mistralai/mistralai": "^1.14",
47
- "@oh-my-pi/pi-utils": "13.1.2",
47
+ "@oh-my-pi/pi-utils": "13.2.0",
48
48
  "@sinclair/typebox": "^0.34",
49
49
  "@smithy/node-http-handler": "^4.4",
50
50
  "ajv": "^8.18",
@@ -555,7 +555,7 @@ function convertToolConfig(
555
555
  const bedrockTools: BedrockTool[] = tools.map(tool => ({
556
556
  toolSpec: {
557
557
  name: tool.name,
558
- description: tool.description,
558
+ description: tool.description || "",
559
559
  inputSchema: { json: tool.parameters },
560
560
  },
561
561
  }));
@@ -1096,7 +1096,7 @@ function convertTools(tools: Tool[], isOAuthToken: boolean): Anthropic.Messages.
1096
1096
 
1097
1097
  return {
1098
1098
  name: isOAuthToken ? toClaudeCodeName(tool.name) : tool.name,
1099
- description: tool.description,
1099
+ description: tool.description || "",
1100
1100
  input_schema: {
1101
1101
  type: "object" as const,
1102
1102
  properties: jsonSchema.properties || {},
@@ -728,7 +728,7 @@ function convertTools(tools: Tool[]): OpenAITool[] {
728
728
  return tools.map(tool => ({
729
729
  type: "function",
730
730
  name: tool.name,
731
- description: tool.description,
731
+ description: tool.description || "",
732
732
  parameters: tool.parameters as Record<string, unknown>,
733
733
  strict: false,
734
734
  }));
@@ -1825,7 +1825,7 @@ function buildMcpToolDefinitions(tools: Tool[] | undefined): McpToolDefinition[]
1825
1825
  const inputSchema = toBinary(ValueSchema, fromJson(ValueSchema, schemaValue));
1826
1826
  return create(McpToolDefinitionSchema, {
1827
1827
  name: tool.name,
1828
- description: tool.description,
1828
+ description: tool.description || "",
1829
1829
  providerIdentifier: "pi-agent",
1830
1830
  toolName: tool.name,
1831
1831
  inputSchema,
@@ -624,7 +624,7 @@ export function convertTools(
624
624
  {
625
625
  functionDeclarations: tools.map(tool => ({
626
626
  name: tool.name,
627
- description: tool.description,
627
+ description: tool.description || "",
628
628
  ...(useParameters
629
629
  ? { parameters: prepareSchemaForCloudCodeAssistClaude(tool.parameters) }
630
630
  : { parametersJsonSchema: tool.parameters }),
@@ -1694,7 +1694,7 @@ function convertTools(tools: Tool[]): Array<{
1694
1694
  return {
1695
1695
  type: "function",
1696
1696
  name: tool.name,
1697
- description: tool.description,
1697
+ description: tool.description || "",
1698
1698
  parameters: strict
1699
1699
  ? enforceStrictSchema(tool.parameters as unknown as Record<string, unknown>)
1700
1700
  : (tool.parameters as unknown as Record<string, unknown>),
@@ -895,7 +895,7 @@ function convertTools(tools: Tool[], compat: ResolvedOpenAICompat): OpenAI.Chat.
895
895
  type: "function",
896
896
  function: {
897
897
  name: tool.name,
898
- description: tool.description,
898
+ description: tool.description || "",
899
899
  parameters: strict
900
900
  ? enforceStrictSchema(tool.parameters as unknown as Record<string, unknown>)
901
901
  : (tool.parameters as unknown as Record<string, unknown>),
@@ -926,7 +926,8 @@ function mapStopReason(reason: ChatCompletionChunk.Choice["finish_reason"]): Sto
926
926
  }
927
927
 
928
928
  function detectStrictModeSupport(provider: string, baseUrl: string): boolean {
929
- if (provider === "openai" || provider === "cerebras" || provider === "together") return true;
929
+ if (provider === "openai" || provider === "cerebras" || provider === "together" || provider === "github-copilot")
930
+ return true;
930
931
 
931
932
  const normalizedBaseUrl = baseUrl.toLowerCase();
932
933
  return (
@@ -471,7 +471,7 @@ function isAzureOpenAIBaseUrl(baseUrl: string): boolean {
471
471
  }
472
472
 
473
473
  function supportsStrictMode(model: Model<"openai-responses">): boolean {
474
- if (model.provider === "openai" || model.provider === "azure") return true;
474
+ if (model.provider === "openai" || model.provider === "azure" || model.provider === "github-copilot") return true;
475
475
 
476
476
  const baseUrl = model.baseUrl.toLowerCase();
477
477
  return (
@@ -677,7 +677,7 @@ function convertTools(tools: Tool[], strictMode: boolean): OpenAITool[] {
677
677
  return {
678
678
  type: "function",
679
679
  name: tool.name,
680
- description: tool.description,
680
+ description: tool.description || "",
681
681
  parameters,
682
682
  ...(strict && { strict: true }),
683
683
  } as OpenAITool;