update dist
This commit is contained in:
48
README.md
48
README.md
@@ -140,12 +140,12 @@ modelParameters:
|
||||
temperature: 0.7
|
||||
```
|
||||
|
||||
| Key | Type | Description |
|
||||
| --------------------- | ------ | -------------------------------------------------------------- |
|
||||
| `maxCompletionTokens` | number | The maximum number of tokens to generate |
|
||||
| `maxTokens` | number | The maximum number of tokens to generate (deprecated) |
|
||||
| `temperature` | number | The sampling temperature to use (0-1) |
|
||||
| `topP` | number | The nucleus sampling parameter to use (0-1) |
|
||||
| Key | Type | Description |
|
||||
| --------------------- | ------ | ----------------------------------------------------- |
|
||||
| `maxCompletionTokens` | number | The maximum number of tokens to generate |
|
||||
| `maxTokens` | number | The maximum number of tokens to generate (deprecated) |
|
||||
| `temperature` | number | The sampling temperature to use (0-1) |
|
||||
| `topP` | number | The nucleus sampling parameter to use (0-1) |
|
||||
|
||||
> ![Note]
|
||||
> Parameters set in `modelParameters` take precedence over the corresponding action inputs.
|
||||
@@ -303,24 +303,24 @@ perform actions like searching issues and PRs.
|
||||
Various inputs are defined in [`action.yml`](action.yml) to let you configure
|
||||
the action:
|
||||
|
||||
| Name | Description | Default |
|
||||
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ |
|
||||
| `token` | Token to use for inference. Typically the GITHUB_TOKEN secret | `github.token` |
|
||||
| `prompt` | The prompt to send to the model | N/A |
|
||||
| `prompt-file` | Path to a file containing the prompt (supports .txt and .prompt.yml formats). If both `prompt` and `prompt-file` are provided, `prompt-file` takes precedence | `""` |
|
||||
| `input` | Template variables in YAML format for .prompt.yml files (e.g., `var1: value1` on separate lines) | `""` |
|
||||
| `file_input` | Template variables in YAML where values are file paths. The file contents are read and used for templating | `""` |
|
||||
| `system-prompt` | The system prompt to send to the model | `"You are a helpful assistant"` |
|
||||
| `system-prompt-file` | Path to a file containing the system prompt. If both `system-prompt` and `system-prompt-file` are provided, `system-prompt-file` takes precedence | `""` |
|
||||
| `model` | The model to use for inference. Must be available in the [GitHub Models](https://github.com/marketplace?type=models) catalog | `openai/gpt-4o` |
|
||||
| `endpoint` | The endpoint to use for inference. If you're running this as part of an org, you should probably use the org-specific Models endpoint | `https://models.github.ai/inference` |
|
||||
| `max-tokens` | The maximum number of tokens to generate (deprecated, use `max-completion-tokens` instead) | 200 |
|
||||
| `max-completion-tokens` | The maximum number of tokens to generate | `""` |
|
||||
| `temperature` | The sampling temperature to use (0-1) | `""` |
|
||||
| `top-p` | The nucleus sampling parameter to use (0-1) | `""` |
|
||||
| `enable-github-mcp` | Enable Model Context Protocol integration with GitHub tools | `false` |
|
||||
| `github-mcp-token` | Token to use for GitHub MCP server (defaults to the main token if not specified). | `""` |
|
||||
| `custom-headers` | 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. | `""` |
|
||||
| Name | Description | Default |
|
||||
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ |
|
||||
| `token` | Token to use for inference. Typically the GITHUB_TOKEN secret | `github.token` |
|
||||
| `prompt` | The prompt to send to the model | N/A |
|
||||
| `prompt-file` | Path to a file containing the prompt (supports .txt and .prompt.yml formats). If both `prompt` and `prompt-file` are provided, `prompt-file` takes precedence | `""` |
|
||||
| `input` | Template variables in YAML format for .prompt.yml files (e.g., `var1: value1` on separate lines) | `""` |
|
||||
| `file_input` | Template variables in YAML where values are file paths. The file contents are read and used for templating | `""` |
|
||||
| `system-prompt` | The system prompt to send to the model | `"You are a helpful assistant"` |
|
||||
| `system-prompt-file` | Path to a file containing the system prompt. If both `system-prompt` and `system-prompt-file` are provided, `system-prompt-file` takes precedence | `""` |
|
||||
| `model` | The model to use for inference. Must be available in the [GitHub Models](https://github.com/marketplace?type=models) catalog | `openai/gpt-4o` |
|
||||
| `endpoint` | The endpoint to use for inference. If you're running this as part of an org, you should probably use the org-specific Models endpoint | `https://models.github.ai/inference` |
|
||||
| `max-tokens` | The maximum number of tokens to generate (deprecated, use `max-completion-tokens` instead) | 200 |
|
||||
| `max-completion-tokens` | The maximum number of tokens to generate | `""` |
|
||||
| `temperature` | The sampling temperature to use (0-1) | `""` |
|
||||
| `top-p` | The nucleus sampling parameter to use (0-1) | `""` |
|
||||
| `enable-github-mcp` | Enable Model Context Protocol integration with GitHub tools | `false` |
|
||||
| `github-mcp-token` | Token to use for GitHub MCP server (defaults to the main token if not specified). | `""` |
|
||||
| `custom-headers` | 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. | `""` |
|
||||
|
||||
## Outputs
|
||||
|
||||
|
||||
3
dist/index.js
generated
vendored
3
dist/index.js
generated
vendored
@@ -58300,7 +58300,6 @@ OpenAI.Responses = Responses;
|
||||
OpenAI.Evals = Evals;
|
||||
OpenAI.Containers = Containers;
|
||||
|
||||
// Note: solution around models using different underlying max tokens properties
|
||||
/**
|
||||
* Build according to what input was passed, default to max_tokens.
|
||||
* Only one of max_tokens or max_completion_tokens will be set.
|
||||
@@ -58366,7 +58365,7 @@ async function mcpInference(request, githubMcpClient) {
|
||||
model: request.modelName,
|
||||
temperature: request.temperature,
|
||||
top_p: request.topP,
|
||||
...buildMaxTokensParam(request),
|
||||
...buildMaxTokensParam(request), // Note: solution around models using different underlying max tokens properties
|
||||
};
|
||||
// Add response format if specified (only on final iteration to avoid conflicts with tool calls)
|
||||
if (finalMessage && request.responseFormat) {
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
import * as core from '@actions/core'
|
||||
import OpenAI from 'openai'
|
||||
import { GitHubMCPClient, executeToolCalls, ToolCall } from './mcp.js'
|
||||
import {GitHubMCPClient, executeToolCalls, ToolCall} from './mcp.js'
|
||||
|
||||
interface ChatMessage {
|
||||
role: 'system' | 'user' | 'assistant' | 'tool'
|
||||
@@ -10,7 +10,7 @@ interface ChatMessage {
|
||||
}
|
||||
|
||||
export interface InferenceRequest {
|
||||
messages: Array<{ role: 'system' | 'user' | 'assistant' | 'tool'; content: string }>
|
||||
messages: Array<{role: 'system' | 'user' | 'assistant' | 'tool'; content: string}>
|
||||
modelName: string
|
||||
maxTokens?: number // Deprecated
|
||||
maxCompletionTokens?: number
|
||||
@@ -18,7 +18,7 @@ export interface InferenceRequest {
|
||||
token: string
|
||||
temperature?: number
|
||||
topP?: number
|
||||
responseFormat?: { type: 'json_schema'; json_schema: unknown } // Processed response format for the API
|
||||
responseFormat?: {type: 'json_schema'; json_schema: unknown} // Processed response format for the API
|
||||
customHeaders?: Record<string, string> // Custom HTTP headers to include in API requests
|
||||
}
|
||||
|
||||
@@ -34,17 +34,16 @@ export interface InferenceResponse {
|
||||
}>
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build according to what input was passed, default to max_tokens.
|
||||
* Only one of max_tokens or max_completion_tokens will be set.
|
||||
*/
|
||||
function buildMaxTokensParam(request: InferenceRequest): { max_tokens?: number; max_completion_tokens?: number } {
|
||||
function buildMaxTokensParam(request: InferenceRequest): {max_tokens?: number; max_completion_tokens?: number} {
|
||||
if (request.maxCompletionTokens != null) {
|
||||
return { max_completion_tokens: request.maxCompletionTokens }
|
||||
return {max_completion_tokens: request.maxCompletionTokens}
|
||||
}
|
||||
if (request.maxTokens != null) {
|
||||
return { max_tokens: request.maxTokens }
|
||||
return {max_tokens: request.maxTokens}
|
||||
}
|
||||
return {}
|
||||
}
|
||||
@@ -137,7 +136,7 @@ export async function mcpInference(
|
||||
messages.push({
|
||||
role: 'assistant',
|
||||
content: modelResponse || '',
|
||||
...(toolCalls && { tool_calls: toolCalls as ToolCall[] }),
|
||||
...(toolCalls && {tool_calls: toolCalls as ToolCall[]}),
|
||||
})
|
||||
|
||||
if (!toolCalls || toolCalls.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user