update dist
This commit is contained in:
@@ -141,7 +141,7 @@ modelParameters:
|
|||||||
```
|
```
|
||||||
|
|
||||||
| 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) |
|
||||||
@@ -304,7 +304,7 @@ 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 | `""` |
|
||||||
|
|||||||
+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