Skip to content

Conversation

@ultmaster
Copy link
Contributor

@ultmaster ultmaster commented Aug 21, 2025

  • Isolate meta documents
  • Support overriding providers
  • Allow schema with tools
  • Other minor bug fixes

Copilot AI review requested due to automatic review settings August 21, 2025 07:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables the simultaneous use of response schemas and tools in VS Code test commands, which were previously mutually exclusive. The change consolidates the two separate streaming methods into a unified approach.

  • Removes the restriction preventing tools and response schemas from being used together
  • Consolidates handleResponseSchemaStream and handleRegularTextStream into a single handleTextStream method
  • Updates documentation to reflect that tools can coexist with response schemas

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/poml-vscode/command/testCommand.ts Removes mutual exclusion logic, consolidates streaming methods, and implements unified handling of tools and response schemas
docs/language/standalone.md Updates documentation to remove the mutual exclusion statement and clarifies tools can work with response schemas

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

import { createGoogleGenerativeAI } from '@ai-sdk/google';
import { createAzure } from '@ai-sdk/azure';
import { ModelMessage, streamText, tool, jsonSchema, Tool, streamObject, TextStreamPart, TextPart, ImagePart, ToolCallPart, ToolResultPart } from 'ai';
import { ModelMessage, streamText, tool, jsonSchema, Tool, TextStreamPart, TextPart, ImagePart, ToolCallPart, ToolResultPart } from 'ai';
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

The streamObject import was removed but may still be needed elsewhere in the codebase. Consider verifying all usage has been migrated to the new unified approach.

Copilot uses AI. Check for mistakes.
// Immediately throw the error
throw error;
},
tools: prompt.tools ? this.toVercelTools(prompt.tools) : undefined,
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

[nitpick] Using experimental_output suggests this is an unstable API. Consider adding a comment explaining this is experimental and may change in future versions.

Suggested change
tools: prompt.tools ? this.toVercelTools(prompt.tools) : undefined,
tools: prompt.tools ? this.toVercelTools(prompt.tools) : undefined,
// NOTE: The `experimental_output` property is an experimental/unstable API and may change or be removed in future versions of the library.

Copilot uses AI. Check for mistakes.
parsePartial: async ({ text }) => {
try {
return { partial: JSON.parse(text) };
} catch {
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

The empty catch block silently ignores parsing errors. Consider logging the error or adding a comment explaining why the error is intentionally ignored.

Suggested change
} catch {
} catch (err) {
console.warn('Failed to parse partial JSON output:', err, 'Input text:', text);

Copilot uses AI. Check for mistakes.
@ultmaster ultmaster requested a review from Copilot August 22, 2025 08:43
@ultmaster ultmaster changed the title Allow schemas with tools Allow schemas with tools and support overriding providers Aug 22, 2025
@ultmaster ultmaster merged commit 7ed5172 into main Aug 22, 2025
7 checks passed
@ultmaster ultmaster deleted the codex/remove-schema-and-tool-use-restriction branch August 27, 2025 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants