gitpt 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const userPrompt
|
|
1
|
+
export declare const userPrompt: (context: string) => string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export const userPrompt = `
|
|
1
|
+
export const userPrompt = (context) => `
|
|
2
2
|
Generate a pull request title and description for the following changes:
|
|
3
3
|
|
|
4
|
+
${context}
|
|
5
|
+
|
|
4
6
|
Format your response exactly like this example:
|
|
5
7
|
Title: Add user authentication with JWT
|
|
6
8
|
Description:
|
|
@@ -7,7 +7,7 @@ import { getPRContext } from "./getPRContext.js";
|
|
|
7
7
|
export const generatePRDetails = async () => {
|
|
8
8
|
const { model } = getConfig();
|
|
9
9
|
const context = getPRContext().join("\n\n");
|
|
10
|
-
const userPromptWithContext =
|
|
10
|
+
const userPromptWithContext = userPrompt(context);
|
|
11
11
|
const llmClient = getLLMClient();
|
|
12
12
|
try {
|
|
13
13
|
const response = await llmClient.chat.completions.create({
|
package/dist/llm/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import { formatBaseURL } from "../utils/formatBaseURL.js";
|
|
|
4
4
|
export const OPENROUTER_API_URL = "https://openrouter.ai/api/v1";
|
|
5
5
|
export const getLLMClient = (options) => {
|
|
6
6
|
const { baseURLOverride } = options || {};
|
|
7
|
-
const { apiKey, customLLMEndpoint } = getConfig();
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
const { apiKey, customLLMEndpoint, provider } = getConfig();
|
|
8
|
+
const localLLMEndpoint = provider === "local" ? customLLMEndpoint : undefined;
|
|
9
|
+
const baseURL = formatBaseURL(baseURLOverride ?? localLLMEndpoint ?? OPENROUTER_API_URL);
|
|
10
10
|
return new openai.OpenAI({
|
|
11
11
|
apiKey,
|
|
12
12
|
baseURL,
|