Skip to content

Commit

Permalink
Merge pull request #16 from wrtnio/feat/experimental
Browse files Browse the repository at this point in the history
`ISwaggerOperation["x-wrtn-function-select-benchmarks"]`
  • Loading branch information
samchon authored Dec 17, 2024
2 parents f59771f + 201c6d5 commit 8718c49
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wrtnio/schema",
"version": "3.1.0",
"version": "3.2.0",
"description": "JSON and LLM function calling schemas extended for Wrtn Studio Pro",
"main": "lib/index.js",
"module": "./lib/index.mjs",
Expand Down Expand Up @@ -31,13 +31,13 @@
},
"homepage": "https://github.com/wrtnio/schema#readme",
"dependencies": {
"@samchon/openapi": "^2.1.2"
"@samchon/openapi": "^2.2.1"
},
"devDependencies": {
"@nestia/core": "^4.2.0",
"@nestia/core": "^4.4.2",
"@nestia/e2e": "^0.7.0",
"@nestia/fetcher": "^4.2.0",
"@nestia/sdk": "^4.2.0",
"@nestia/fetcher": "^4.4.2",
"@nestia/sdk": "^4.4.2",
"@nestjs/common": "^10.4.12",
"@nestjs/core": "^10.4.12",
"@nestjs/platform-express": "^10.4.12",
Expand All @@ -52,9 +52,9 @@
"rollup": "^4.22.0",
"source-map-support": "^0.5.21",
"ts-patch": "^3.2.1",
"typescript": "5.5.4",
"typescript": "~5.7.2",
"typescript-transform-paths": "^3.5.2",
"typia": "^7.3.0"
"typia": "^7.4.1"
},
"files": [
"lib",
Expand Down
8 changes: 8 additions & 0 deletions src/ISwaggerOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ declare module "@samchon/openapi" {
* if the property is `true`, the API is only available in the development environment.
*/
"x-wrtn-experimental"?: boolean;

/**
* List of keywords selecting the operation for benchmarks.
*
* `x-wrtn-function-select-benchmarks` is a property which means a list of keywords
* that may cause the LLM function calling selection to be benchmarked.
*/
"x-wrtn-function-select-benchmarks"?: string[];
}
}
}
8 changes: 3 additions & 5 deletions test/features/test_http_llm_separate_parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const test_http_llm_separate_parameters = async (): Promise<void> => {
).then((r) => r.json()),
);
for (const path of Object.keys(document.paths ?? {}))
if (path !== "/connector/notion/database-item/{databaseId}")
if (path !== "/connector/notion/page/bookmark")
delete document.paths?.[path];

const app = HttpOpenAi.application({
Expand All @@ -22,10 +22,8 @@ export const test_http_llm_separate_parameters = async (): Promise<void> => {
},
});
const func = app.functions.find(
(f) =>
f.method === "post" &&
f.path === "/connector/notion/database-item/{databaseId}",
(f) => f.method === "post" && f.path === "/connector/notion/page/bookmark",
);
if (func === undefined) throw new Error("Function not found");
TestValidator.equals("human")(func.separated?.human.at(0)?.index)(1);
TestValidator.equals("human")(func.separated?.human.at(0)?.index)(0);
};

0 comments on commit 8718c49

Please sign in to comment.