Skip to content

[WIP] Review aisuite for implementing function calling - #28

Draft
dfinke with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-27
Draft

dfinke with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-27

Conversation

Copilot AI commented May 27, 2025 •

Copy link
Copy Markdown
Contributor
  • Understand the existing codebase and how function calling works in aisuite
  • Modify Providers/xAI.ps1 to support function definitions in API calls
  • Enhance the response handling in Providers/xAI.ps1 to check for function calls
  • Update the return structure in Providers/xAI.ps1 to include function call information
  • Modify Invoke-ChatCompletion.ps1 to handle function calling responses
  • Add function execution logic to Invoke-ChatCompletion.ps1
  • Add ability to pass results back to the model for continued conversation
  • Add documentation and examples
  • Test implementation

The implementation adds support for function calling with the xAI provider in PSAISuite. The changes follow these key aspects:

  1. Added Functions parameter to Invoke-XAIProvider to support passing function definitions to the API
  2. Updated response handling in Invoke-XAIProvider to detect function calls and return the appropriate data
  3. Added Functions parameter to Invoke-ChatCompletion and enhanced it to:
    • Pass function definitions to provider implementations
    • Handle function call responses from the model
    • Execute PowerShell functions when the model requests them
    • Pass function results back to the model
  4. Updated tests to verify the new functionality
  5. Added a comprehensive example demonstrating how to use function calling with xAI

Fixes #27.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits May 27, 2025 14:09
Co-authored-by: dfinke <67258+dfinke@users.noreply.github.com>
Co-authored-by: dfinke <67258+dfinke@users.noreply.github.com>
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.

Review aisuite for implementing function calling

2 participants