Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config): add descriptions to JSON schema properties #41

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts", "/supabase/*", "dist/**"],
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts", "/supabase/*", "dist/**", "bun.lockb"],
"useGitignore": true,
"language": "en",
"words": [
Expand Down Expand Up @@ -42,7 +42,11 @@
"hono",
"braintrust",
"autoevals",
"SEPERATOR"
"SEPERATOR",
"issuecomment",
"Limitsnew",
"evals",
"commnt"
],
"dictionaries": ["typescript", "node", "software-terms"],
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"],
Expand Down
74 changes: 36 additions & 38 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,47 @@

## [1.1.0](https://github.com/ubiquity-os-marketplace/command-ask/compare/v1.0.0...v1.1.0) (2025-01-11)


### Features

* adds ClosedQA, ContextPrecision ([148a73f](https://github.com/ubiquity-os-marketplace/command-ask/commit/148a73fab8ec0922e833eabde6b1de5d0fddf5ce))

- adds ClosedQA, ContextPrecision ([148a73f](https://github.com/ubiquity-os-marketplace/command-ask/commit/148a73fab8ec0922e833eabde6b1de5d0fddf5ce))

### Bug Fixes

* action ([75a2f87](https://github.com/ubiquity-os-marketplace/command-ask/commit/75a2f87672a77601d5130b38ae34a4f8df9db82f))
* action ([633ebfe](https://github.com/ubiquity-os-marketplace/command-ask/commit/633ebfe917e0a6f0f042b935b2e56238e6e6572b))
* action file dir ([a4351af](https://github.com/ubiquity-os-marketplace/command-ask/commit/a4351afc1f1550699a27585bc7cef839b6fd3b18))
* actions env ([2cb4a14](https://github.com/ubiquity-os-marketplace/command-ask/commit/2cb4a147dad4ba1503760ee0177ad928599b368a))
* add env to the action ([98d3777](https://github.com/ubiquity-os-marketplace/command-ask/commit/98d37775ec9d570e2fd84b12bbc24a1d0aa24c58))
* add github token to the braintrust ([2bad0fe](https://github.com/ubiquity-os-marketplace/command-ask/commit/2bad0fee4135072523cd5bd6e1d93c9cc86207cf))
* add workflow dispatch ([a8922db](https://github.com/ubiquity-os-marketplace/command-ask/commit/a8922dba40ff84d0d9c71f6a602d5d184140f6ef))
* braintrust action ([a518e5e](https://github.com/ubiquity-os-marketplace/command-ask/commit/a518e5ea4261fe733565731d4499a45a1af8698b))
* change to /ask ([a5d9302](https://github.com/ubiquity-os-marketplace/command-ask/commit/a5d930219855bd29c8bfec532be1711ba59e3dfb))
* cspell and knip ([e075c71](https://github.com/ubiquity-os-marketplace/command-ask/commit/e075c71930f039cc3e9abde727cf19d596a3d1d5))
* deps issues ([a077ad8](https://github.com/ubiquity-os-marketplace/command-ask/commit/a077ad8f7045db7c92ed88b20d5c59e3d07fca5b))
* downgraded typebox ([122efad](https://github.com/ubiquity-os-marketplace/command-ask/commit/122efaddc3b34c8fb6348e8cab70e78b07c69ad1))
* evals action ([43e5e50](https://github.com/ubiquity-os-marketplace/command-ask/commit/43e5e50fec15914d05adc0a3aacaf85b9caf8bbc))
* evals secrets ([2f0cb7a](https://github.com/ubiquity-os-marketplace/command-ask/commit/2f0cb7a86d123ea6c96ef8baca7be19243c94d2a))
* evals workflow ([fa8934f](https://github.com/ubiquity-os-marketplace/command-ask/commit/fa8934f26b77990f881f27a1a076367c13d2f3af))
* fix knip ([dd39b3b](https://github.com/ubiquity-os-marketplace/command-ask/commit/dd39b3b25d5a1cd869f08b8f3dc3258ec12e6f09))
* fixed lockfile ([171e427](https://github.com/ubiquity-os-marketplace/command-ask/commit/171e42797b6ed55d9e7178dc48daea83a5523508))
* formatting ([cfe8c4d](https://github.com/ubiquity-os-marketplace/command-ask/commit/cfe8c4d165a1d6225cac9e92b7271f55ddaa7d43))
* github action ([139770e](https://github.com/ubiquity-os-marketplace/command-ask/commit/139770e046829cde75d20b84e3366e5c9647316d))
* lockfile ([64263de](https://github.com/ubiquity-os-marketplace/command-ask/commit/64263de31897adaaf6b0e3c21edf26b966d4f14b))
* log env ([1d2309c](https://github.com/ubiquity-os-marketplace/command-ask/commit/1d2309c7d662f0a885353690355ccdffe5e9d43a))
* ncc compile error ([7ec1087](https://github.com/ubiquity-os-marketplace/command-ask/commit/7ec10877df9b238d6b1db386b8f88baee4fd3eb9))
* ncc compile error ([fe11d1b](https://github.com/ubiquity-os-marketplace/command-ask/commit/fe11d1beb636dd3ef3964802a50fc96ec2dce298))
* package.json duplicate items ([4a9df8a](https://github.com/ubiquity-os-marketplace/command-ask/commit/4a9df8a5a07c1c1fff2081e509a4ecc28e7154d1))
* prettier and jest ([cab2349](https://github.com/ubiquity-os-marketplace/command-ask/commit/cab2349c12f870066171acd5e1ae8bc2615688ac))
* remove unused deps ([766e23f](https://github.com/ubiquity-os-marketplace/command-ask/commit/766e23f393752345d8aeb48e53552ee5859a701c))
* removed ClosedQA ([ae6d163](https://github.com/ubiquity-os-marketplace/command-ask/commit/ae6d163593fc1ab6aa4198f9c1dba97fb7284680))
* setup evals actions ([e61e401](https://github.com/ubiquity-os-marketplace/command-ask/commit/e61e4012095ee9958d3f47298053190f382d10c4))
* setup evals actions ([5177c29](https://github.com/ubiquity-os-marketplace/command-ask/commit/5177c2959d566e45eef19e9bdc597815595220d3))
* update permission ([399d80a](https://github.com/ubiquity-os-marketplace/command-ask/commit/399d80a49d52b148113d74d34750702eb911b6d6))
* update permission ([8dfe444](https://github.com/ubiquity-os-marketplace/command-ask/commit/8dfe444e6486a2f8206385a66239c03043f76e57))
* update workflow ([75779f8](https://github.com/ubiquity-os-marketplace/command-ask/commit/75779f8840b0c1d92dd0bd2cc4a53c34dbbcbfb6))
* updated package.json ([022b9ce](https://github.com/ubiquity-os-marketplace/command-ask/commit/022b9ce1998435b2831f75c268601828c58a4f55))
* updated workflow ([311fc4a](https://github.com/ubiquity-os-marketplace/command-ask/commit/311fc4a3f94baf12af4dc8fbce3e0a6c16ec429e))
* updated workflow ([58c01ac](https://github.com/ubiquity-os-marketplace/command-ask/commit/58c01ac83df68e9e54497f23e26869a7f6a93988))
- action ([75a2f87](https://github.com/ubiquity-os-marketplace/command-ask/commit/75a2f87672a77601d5130b38ae34a4f8df9db82f))
- action ([633ebfe](https://github.com/ubiquity-os-marketplace/command-ask/commit/633ebfe917e0a6f0f042b935b2e56238e6e6572b))
- action file dir ([a4351af](https://github.com/ubiquity-os-marketplace/command-ask/commit/a4351afc1f1550699a27585bc7cef839b6fd3b18))
- actions env ([2cb4a14](https://github.com/ubiquity-os-marketplace/command-ask/commit/2cb4a147dad4ba1503760ee0177ad928599b368a))
- add env to the action ([98d3777](https://github.com/ubiquity-os-marketplace/command-ask/commit/98d37775ec9d570e2fd84b12bbc24a1d0aa24c58))
- add github token to the braintrust ([2bad0fe](https://github.com/ubiquity-os-marketplace/command-ask/commit/2bad0fee4135072523cd5bd6e1d93c9cc86207cf))
- add workflow dispatch ([a8922db](https://github.com/ubiquity-os-marketplace/command-ask/commit/a8922dba40ff84d0d9c71f6a602d5d184140f6ef))
- braintrust action ([a518e5e](https://github.com/ubiquity-os-marketplace/command-ask/commit/a518e5ea4261fe733565731d4499a45a1af8698b))
- change to /ask ([a5d9302](https://github.com/ubiquity-os-marketplace/command-ask/commit/a5d930219855bd29c8bfec532be1711ba59e3dfb))
- cspell and knip ([e075c71](https://github.com/ubiquity-os-marketplace/command-ask/commit/e075c71930f039cc3e9abde727cf19d596a3d1d5))
- deps issues ([a077ad8](https://github.com/ubiquity-os-marketplace/command-ask/commit/a077ad8f7045db7c92ed88b20d5c59e3d07fca5b))
- downgraded typebox ([122efad](https://github.com/ubiquity-os-marketplace/command-ask/commit/122efaddc3b34c8fb6348e8cab70e78b07c69ad1))
- evals action ([43e5e50](https://github.com/ubiquity-os-marketplace/command-ask/commit/43e5e50fec15914d05adc0a3aacaf85b9caf8bbc))
- evals secrets ([2f0cb7a](https://github.com/ubiquity-os-marketplace/command-ask/commit/2f0cb7a86d123ea6c96ef8baca7be19243c94d2a))
- evals workflow ([fa8934f](https://github.com/ubiquity-os-marketplace/command-ask/commit/fa8934f26b77990f881f27a1a076367c13d2f3af))
- fix knip ([dd39b3b](https://github.com/ubiquity-os-marketplace/command-ask/commit/dd39b3b25d5a1cd869f08b8f3dc3258ec12e6f09))
- fixed lockfile ([171e427](https://github.com/ubiquity-os-marketplace/command-ask/commit/171e42797b6ed55d9e7178dc48daea83a5523508))
- formatting ([cfe8c4d](https://github.com/ubiquity-os-marketplace/command-ask/commit/cfe8c4d165a1d6225cac9e92b7271f55ddaa7d43))
- github action ([139770e](https://github.com/ubiquity-os-marketplace/command-ask/commit/139770e046829cde75d20b84e3366e5c9647316d))
- lockfile ([64263de](https://github.com/ubiquity-os-marketplace/command-ask/commit/64263de31897adaaf6b0e3c21edf26b966d4f14b))
- log env ([1d2309c](https://github.com/ubiquity-os-marketplace/command-ask/commit/1d2309c7d662f0a885353690355ccdffe5e9d43a))
- ncc compile error ([7ec1087](https://github.com/ubiquity-os-marketplace/command-ask/commit/7ec10877df9b238d6b1db386b8f88baee4fd3eb9))
- ncc compile error ([fe11d1b](https://github.com/ubiquity-os-marketplace/command-ask/commit/fe11d1beb636dd3ef3964802a50fc96ec2dce298))
- package.json duplicate items ([4a9df8a](https://github.com/ubiquity-os-marketplace/command-ask/commit/4a9df8a5a07c1c1fff2081e509a4ecc28e7154d1))
- prettier and jest ([cab2349](https://github.com/ubiquity-os-marketplace/command-ask/commit/cab2349c12f870066171acd5e1ae8bc2615688ac))
- remove unused deps ([766e23f](https://github.com/ubiquity-os-marketplace/command-ask/commit/766e23f393752345d8aeb48e53552ee5859a701c))
- removed ClosedQA ([ae6d163](https://github.com/ubiquity-os-marketplace/command-ask/commit/ae6d163593fc1ab6aa4198f9c1dba97fb7284680))
- setup evals actions ([e61e401](https://github.com/ubiquity-os-marketplace/command-ask/commit/e61e4012095ee9958d3f47298053190f382d10c4))
- setup evals actions ([5177c29](https://github.com/ubiquity-os-marketplace/command-ask/commit/5177c2959d566e45eef19e9bdc597815595220d3))
- update permission ([399d80a](https://github.com/ubiquity-os-marketplace/command-ask/commit/399d80a49d52b148113d74d34750702eb911b6d6))
- update permission ([8dfe444](https://github.com/ubiquity-os-marketplace/command-ask/commit/8dfe444e6486a2f8206385a66239c03043f76e57))
- update workflow ([75779f8](https://github.com/ubiquity-os-marketplace/command-ask/commit/75779f8840b0c1d92dd0bd2cc4a53c34dbbcbfb6))
- updated package.json ([022b9ce](https://github.com/ubiquity-os-marketplace/command-ask/commit/022b9ce1998435b2831f75c268601828c58a4f55))
- updated workflow ([311fc4a](https://github.com/ubiquity-os-marketplace/command-ask/commit/311fc4a3f94baf12af4dc8fbce3e0a6c16ec429e))
- updated workflow ([58c01ac](https://github.com/ubiquity-os-marketplace/command-ask/commit/58c01ac83df68e9e54497f23e26869a7f6a93988))

## 1.0.0 (2024-11-29)

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions evals/handlers/setup-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface EvalClients {
openai: OpenAI;
}

export const initAdapters = (context: Context, clients: EvalClients): Context => {
export function initAdapters(context: Context, clients: EvalClients): Context {
const adapters = createAdapters(clients.supabase, clients.voyage, clients.openai, context);
context.adapters = adapters;

Expand All @@ -35,7 +35,7 @@ export const initAdapters = (context: Context, clients: EvalClients): Context =>
});
});
return context;
};
}

export async function fetchContext(context: Context, question: string): Promise<FetchContext> {
const {
Expand Down
6 changes: 6 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,23 @@
"properties": {
"model": {
"default": "o1-mini",
"description": "The LLM model you wish to use",
"examples": ["openai/gpt-4o", "openai/o1-mini"],
"type": "string"
},
"openAiBaseUrl": {
"description": "The base URL for the OpenAI API",
"examples": ["https://openrouter.ai/api/v1", "https://api.openai.com/v1"],
"type": "string"
},
"similarityThreshold": {
"default": 0.9,
"description": "When fetching embeddings context, the similarity threshold to use (1- similarityThreshold)",
"type": "number"
Keyrxng marked this conversation as resolved.
Show resolved Hide resolved
},
"maxDepth": {
"default": 3,
"description": "The max depth of referenced github issues to traverse for context",
"type": "number"
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/handlers/ground-truths/chat-bot.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Context } from "../../types";
import { logger } from "../../helpers/errors";
import { RepoLanguages } from "../../types/github-types";

export async function fetchRepoDependencies(context: Context) {
const {
Expand Down Expand Up @@ -51,10 +52,10 @@ export async function fetchRepoLanguageStats(context: Context) {
},
} = context;
try {
const { data: languages } = await octokit.rest.repos.listLanguages({
const { data: languages } = (await octokit.rest.repos.listLanguages({
owner,
repo,
});
})) as { data: RepoLanguages };

const totalBytes = Object.values(languages).reduce((acc, bytes) => acc + bytes, 0);

Expand Down
8 changes: 4 additions & 4 deletions src/helpers/format-chat-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ async function buildTree(
const references = refs || new Set<string>();

// Helper function to validate and add references
const validateAndAddReferences = async (text: string) => {
async function validateAndAddReferences(text: string) {
const refs = await extractReferencedIssuesAndPrs(text, owner, repo);
refs.forEach((ref) => {
if (validateGitHubKey(ref) && !linkedIssueKeys.has(ref) && !processedNodes.has(ref) && !processingStack.has(ref)) {
references.add(ref);
}
});
};
}

// Process body references
if (node.body) {
Expand Down Expand Up @@ -319,15 +319,15 @@ async function processNodeContent(
const contentPrefix = childPrefix + " ";

// Helper function to add content if tokens allow
const tryAddContent = (content: string[], tokenLimit: TokenLimits): boolean => {
function tryAddContent(content: string[], tokenLimit: TokenLimits): boolean {
const tempLimit = { ...tokenLimit };
if (content.every((line) => updateTokenCount(line, tempLimit))) {
content.forEach((line) => updateTokenCount(line, tokenLimit));
output.push(...content);
return true;
}
return false;
};
}

// Process body (truncate if needed)
if (node.body?.trim()) {
Expand Down
2 changes: 2 additions & 0 deletions src/types/github-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { RestEndpointMethodTypes } from "@octokit/rest";
import { Context } from "./context";
import { StreamlinedComment } from "./llm";

export type RepoLanguages = RestEndpointMethodTypes["repos"]["listLanguages"]["response"]["data"];

type BaseIssue = RestEndpointMethodTypes["issues"]["get"]["response"]["data"];
export interface Issue extends BaseIssue {
prDetails?: PullRequestDetails;
Expand Down
17 changes: 13 additions & 4 deletions src/types/plugin-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ import { StaticDecode, Type as T } from "@sinclair/typebox";
*/

export const pluginSettingsSchema = T.Object({
model: T.String({ default: "o1-mini" }),
openAiBaseUrl: T.Optional(T.String()),
similarityThreshold: T.Number({ default: 0.9 }),
maxDepth: T.Optional(T.Number({ default: 3 })), // max depth of the chat history to be fetched
model: T.String({
default: "o1-mini",
description: "The LLM model you wish to use",
examples: ["openai/gpt-4o", "openai/o1-mini"],
}),
openAiBaseUrl: T.Optional(
T.String({
description: "The base URL for the OpenAI API",
examples: ["https://openrouter.ai/api/v1", "https://api.openai.com/v1"],
})
),
similarityThreshold: T.Number({ default: 0.9, description: "When fetching embeddings context, the similarity threshold to use (1- similarityThreshold)" }),
maxDepth: T.Optional(T.Number({ default: 3, description: "The max depth of referenced github issues to traverse for context" })), // max depth of the chat history to be fetched
});

export type PluginSettings = StaticDecode<typeof pluginSettingsSchema>;