Files
ai-inference/action.yml

72 lines
1.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:
2025-04-07 00:09:42 +00:00
description: The maximum number of tokens to generate
required: false
default: '200'
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 GITHUB_TOKEN if not specified)
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:
using: node20
main: dist/index.js