update dist
This commit is contained in:
@@ -140,12 +140,12 @@ modelParameters:
|
|||||||
temperature: 0.7
|
temperature: 0.7
|
||||||
```
|
```
|
||||||
|
|
||||||
| Key | Type | Description |
|
| Key | Type | Description |
|
||||||
| --------------------- | ------ | -------------------------------------------------------------- |
|
| --------------------- | ------ | ----------------------------------------------------- |
|
||||||
| `maxCompletionTokens` | number | The maximum number of tokens to generate |
|
| `maxCompletionTokens` | number | The maximum number of tokens to generate |
|
||||||
| `maxTokens` | number | The maximum number of tokens to generate (deprecated) |
|
| `maxTokens` | number | The maximum number of tokens to generate (deprecated) |
|
||||||
| `temperature` | number | The sampling temperature to use (0-1) |
|
| `temperature` | number | The sampling temperature to use (0-1) |
|
||||||
| `topP` | number | The nucleus sampling parameter to use (0-1) |
|
| `topP` | number | The nucleus sampling parameter to use (0-1) |
|
||||||
|
|
||||||
> ![Note]
|
> ![Note]
|
||||||
> Parameters set in `modelParameters` take precedence over the corresponding action inputs.
|
> 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
|
Various inputs are defined in [`action.yml`](action.yml) to let you configure
|
||||||
the action:
|
the action:
|
||||||
|
|
||||||
| Name | Description | Default |
|
| Name | Description | Default |
|
||||||
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ |
|
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ |
|
||||||
| `token` | Token to use for inference. Typically the GITHUB_TOKEN secret | `github.token` |
|
| `token` | Token to use for inference. Typically the GITHUB_TOKEN secret | `github.token` |
|
||||||
| `prompt` | The prompt to send to the model | N/A |
|
| `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 | `""` |
|
| `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) | `""` |
|
| `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 | `""` |
|
| `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` | 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 | `""` |
|
| `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` |
|
| `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` |
|
| `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-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 | `""` |
|
| `max-completion-tokens` | The maximum number of tokens to generate | `""` |
|
||||||
| `temperature` | The sampling temperature to use (0-1) | `""` |
|
| `temperature` | The sampling temperature to use (0-1) | `""` |
|
||||||
| `top-p` | The nucleus sampling parameter 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` |
|
| `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). | `""` |
|
| `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. | `""` |
|
| `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
|
## Outputs
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -58300,7 +58300,6 @@ OpenAI.Responses = Responses;
|
|||||||
OpenAI.Evals = Evals;
|
OpenAI.Evals = Evals;
|
||||||
OpenAI.Containers = Containers;
|
OpenAI.Containers = Containers;
|
||||||
|
|
||||||
// Note: solution around models using different underlying max tokens properties
|
|
||||||
/**
|
/**
|
||||||
* Build according to what input was passed, default to max_tokens.
|
* Build according to what input was passed, default to max_tokens.
|
||||||
* Only one of max_tokens or max_completion_tokens will be set.
|
* Only one of max_tokens or max_completion_tokens will be set.
|
||||||
@@ -58366,7 +58365,7 @@ async function mcpInference(request, githubMcpClient) {
|
|||||||
model: request.modelName,
|
model: request.modelName,
|
||||||
temperature: request.temperature,
|
temperature: request.temperature,
|
||||||
top_p: request.topP,
|
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)
|
// Add response format if specified (only on final iteration to avoid conflicts with tool calls)
|
||||||
if (finalMessage && request.responseFormat) {
|
if (finalMessage && request.responseFormat) {
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
+7
-8
@@ -1,6 +1,6 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import OpenAI from 'openai'
|
import OpenAI from 'openai'
|
||||||
import { GitHubMCPClient, executeToolCalls, ToolCall } from './mcp.js'
|
import {GitHubMCPClient, executeToolCalls, ToolCall} from './mcp.js'
|
||||||
|
|
||||||
interface ChatMessage {
|
interface ChatMessage {
|
||||||
role: 'system' | 'user' | 'assistant' | 'tool'
|
role: 'system' | 'user' | 'assistant' | 'tool'
|
||||||
@@ -10,7 +10,7 @@ interface ChatMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface InferenceRequest {
|
export interface InferenceRequest {
|
||||||
messages: Array<{ role: 'system' | 'user' | 'assistant' | 'tool'; content: string }>
|
messages: Array<{role: 'system' | 'user' | 'assistant' | 'tool'; content: string}>
|
||||||
modelName: string
|
modelName: string
|
||||||
maxTokens?: number // Deprecated
|
maxTokens?: number // Deprecated
|
||||||
maxCompletionTokens?: number
|
maxCompletionTokens?: number
|
||||||
@@ -18,7 +18,7 @@ export interface InferenceRequest {
|
|||||||
token: string
|
token: string
|
||||||
temperature?: number
|
temperature?: number
|
||||||
topP?: 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
|
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.
|
* Build according to what input was passed, default to max_tokens.
|
||||||
* Only one of max_tokens or max_completion_tokens will be set.
|
* 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) {
|
if (request.maxCompletionTokens != null) {
|
||||||
return { max_completion_tokens: request.maxCompletionTokens }
|
return {max_completion_tokens: request.maxCompletionTokens}
|
||||||
}
|
}
|
||||||
if (request.maxTokens != null) {
|
if (request.maxTokens != null) {
|
||||||
return { max_tokens: request.maxTokens }
|
return {max_tokens: request.maxTokens}
|
||||||
}
|
}
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
@@ -137,7 +136,7 @@ export async function mcpInference(
|
|||||||
messages.push({
|
messages.push({
|
||||||
role: 'assistant',
|
role: 'assistant',
|
||||||
content: modelResponse || '',
|
content: modelResponse || '',
|
||||||
...(toolCalls && { tool_calls: toolCalls as ToolCall[] }),
|
...(toolCalls && {tool_calls: toolCalls as ToolCall[]}),
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!toolCalls || toolCalls.length === 0) {
|
if (!toolCalls || toolCalls.length === 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user