Files
ai-inference/action.yml

92 lines
2.9 KiB
YAML
Raw Permalink Normal View History

name: 'AI Inference'
description: Generate an AI response based on a provided prompt
author: 'GitHub'
2025-04-04 07:27:58 +11:00
# Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: 'message-square'
2025-04-04 07:27:58 +11:00
color: red
# Define your inputs here.
inputs:
prompt:
2025-04-07 04:53:19 +00:00
description: The prompt for the model
required: false
default: ''
prompt-file:
description: Path to a file containing the prompt (supports .txt and .prompt.yml
2025-07-21 00:11:26 +00:00
formats)
required: false
default: ''
input:
description: Template variables in YAML format for .prompt.yml files
required: false
default: ''
2025-08-05 01:32:32 +00:00
file_input:
description: Template variables in YAML format mapping variable names to file paths. The file contents will be used for templating.
required: false
default: ''
2025-04-07 00:09:42 +00:00
model:
description: The model to use
required: false
default: 'openai/gpt-4o'
2025-04-07 00:09:42 +00:00
endpoint:
description: The endpoint to use
required: false
default: 'https://models.github.ai/inference'
2025-04-07 04:53:19 +00:00
system-prompt:
description: The system prompt for the model
required: false
default: 'You are a helpful assistant'
feat: Add system-prompt-file input for file-based system prompts This enhancement adds the ability to load a system prompt from a file, similar to the existing prompt-file functionality, providing more flexibility when working with complex system prompts. Key changes: - Added new `system-prompt-file` input to action.yml with proper description - Updated main.ts implementation to handle file-based system prompts with: - File existence checking and appropriate error handling - Proper precedence (system-prompt-file takes priority over system-prompt) - Consistent error messages with existing prompt-file implementation Test coverage added: - Basic usage: Test verifies system-prompt-file loads content correctly - Error handling: Test ensures proper errors when system-prompt-file doesn't exist - Precedence: Test confirms system-prompt-file overrides system-prompt when both exist - Integration: Test validates both prompt-file and system-prompt-file work together - Max tokens: Test verifies custom token limits are properly passed to the model - Testing infrastructure: Improved mock implementations that detect unexpected calls Documentation: - Updated README.md with system-prompt-file in inputs table - Added dedicated usage example for system-prompt-file - Fixed formatting in inputs table CI/CD: - Updated workflow to test system-prompt-file functionality with actual file content This feature maintains backward compatibility while adding a useful option for workflows that need to use more complex system prompts stored in files.
2025-05-24 03:50:15 +02:00
system-prompt-file:
description: Path to a file containing the system prompt
required: false
default: ''
2025-04-07 04:53:19 +00:00
max-tokens:
2026-02-13 12:38:48 +00:00
description: The maximum number of tokens to generate (deprecated)
2025-04-07 00:09:42 +00:00
required: false
default: '200'
max-completion-tokens:
2026-02-13 12:38:48 +00:00
description: The maximum number of tokens to generate
required: false
default: ''
temperature:
description: The sampling temperature to use (0-1)
required: false
default: ''
top-p:
description: The nucleus sampling parameter to use (0-1)
required: false
default: ''
2025-04-07 04:53:19 +00:00
token:
description: The token to use
required: false
default: ${{ github.token }}
2025-07-16 02:19:49 +00:00
enable-github-mcp:
2025-07-15 23:23:39 +00:00
description: Enable Model Context Protocol integration with GitHub tools
required: false
default: 'false'
2025-08-04 03:06:53 +00:00
github-mcp-token:
description: The token to use for GitHub MCP server (defaults to the main token if not specified). This must be a PAT for MCP to work.
2025-08-04 03:06:53 +00:00
required: false
default: ''
github-mcp-toolsets:
description: 'Comma-separated list of toolsets to enable for GitHub MCP (e.g., "repos,issues,pull_requests,actions"). Use "all" for all toolsets, "default" for default set. If not specified, uses default toolsets (context,repos,issues,pull_requests,users).'
required: false
default: ''
custom-headers:
description: 'Custom HTTP headers to include in API requests. Supports both YAML format (header1: value1) and JSON format ({"header1": "value1"}). Useful for API Management platforms, rate limiting, and request tracking.'
required: false
default: ''
2025-04-04 07:27:58 +11:00
# Define your outputs here.
outputs:
response:
description: The response from the model
2025-04-17 20:23:07 +00:00
response-file:
description: The file path where the response is saved
2025-04-04 07:27:58 +11:00
runs:
2025-08-01 12:13:15 +01:00
using: node24
2025-04-04 07:27:58 +11:00
main: dist/index.js