-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
ILlmFunction.parameters.description
problem.
`typia.llm.application<App, Model>()` function had not filled `ILlmFunction.parameters.description` property. This PR fixes it including the `typia.llm.applicationOfValidate<App, Model>()` function case.
- Loading branch information
Showing
3 changed files
with
126 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,123 @@ | ||
import { ILlmApplication } from "@samchon/openapi"; | ||
import typia from "typia"; | ||
import { ILlmApplication, ILlmFunction } from "@samchon/openapi"; | ||
import typia, { tags } from "typia"; | ||
|
||
interface SomeApplication { | ||
plus(props: { x: number; y: number }): number; | ||
const app: ILlmApplication<"chatgpt"> = typia.llm.application< | ||
BbsArticleController, | ||
"chatgpt" | ||
>(); | ||
const func: ILlmFunction<"chatgpt"> | undefined = app.functions.find( | ||
(func) => func.name === "create", | ||
); | ||
console.log(func?.parameters.description); | ||
console.log(func?.output?.description); | ||
|
||
interface BbsArticleController { | ||
/** | ||
* Create a new article. | ||
* | ||
* Writes a new article and archives it into the DB. | ||
* | ||
* @param props Properties of create function | ||
* @returns Newly created article | ||
*/ | ||
create(props: { | ||
/** | ||
* Information of the article to create | ||
*/ | ||
input: IBbsArticle.ICreate; | ||
}): Promise<IBbsArticle>; | ||
|
||
/** | ||
* @human | ||
* Update an article. | ||
* | ||
* Updates an article with new content. | ||
* | ||
* @param props Properties of update function | ||
* @param input New content to update | ||
*/ | ||
minus(props: { x: number; y: number }): number; | ||
update(props: { | ||
/** | ||
* Target article's {@link IBbsArticle.id}. | ||
*/ | ||
id: string & tags.Format<"uuid">; | ||
|
||
/** | ||
* New content to update. | ||
*/ | ||
input: IBbsArticle.IUpdate; | ||
}): Promise<void>; | ||
|
||
/** | ||
* Erase an article. | ||
* | ||
* Erases an article from the DB. | ||
* | ||
* @param props Properties of erase function | ||
*/ | ||
erase(props: { | ||
/** | ||
* Target article's {@link IBbsArticle.id}. | ||
*/ | ||
id: string & tags.Format<"uuid">; | ||
}): Promise<void>; | ||
} | ||
|
||
const app: ILlmApplication<"chatgpt"> = typia.llm.application< | ||
SomeApplication, | ||
"chatgpt" | ||
>(); | ||
console.log(app); | ||
/** | ||
* Article entity. | ||
* | ||
* `IBbsArticle` is an entity representing an article in the BBS (Bulletin Board System). | ||
*/ | ||
interface IBbsArticle extends IBbsArticle.ICreate { | ||
/** | ||
* Primary Key. | ||
*/ | ||
id: string & tags.Format<"uuid">; | ||
|
||
/** | ||
* Creation time of the article. | ||
*/ | ||
created_at: string & tags.Format<"date-time">; | ||
|
||
/** | ||
* Last updated time of the article. | ||
*/ | ||
updated_at: string & tags.Format<"date-time">; | ||
} | ||
namespace IBbsArticle { | ||
/** | ||
* Information of the article to create. | ||
*/ | ||
export interface ICreate { | ||
/** | ||
* Title of the article. | ||
* | ||
* Representative title of the article. | ||
*/ | ||
title: string; | ||
|
||
/** | ||
* Content body. | ||
* | ||
* Content body of the article writtn in the markdown format. | ||
*/ | ||
body: string; | ||
|
||
/** | ||
* Thumbnail image URI. | ||
* | ||
* Thumbnail image URI which can represent the article. | ||
* | ||
* If configured as `null`, it means that no thumbnail image in the article. | ||
*/ | ||
thumbnail: | ||
| null | ||
| (string & tags.Format<"uri"> & tags.ContentMediaType<"image/*">); | ||
} | ||
|
||
/** | ||
* Information of the article to update. | ||
* | ||
* Only the filled properties will be updated. | ||
*/ | ||
export type IUpdate = Partial<ICreate>; | ||
} |