-
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1438 from samchon/feat/json-validate
Fix LLM schema recursive type detector.
- Loading branch information
Showing
6 changed files
with
261 additions
and
7 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
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 |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import typia from "typia"; | ||
|
||
interface IHierarchical { | ||
children: IHierarchical[]; | ||
} | ||
interface IReference { | ||
parent: IReference | null; | ||
} | ||
|
||
// SCHEMA | ||
typia.llm.schema< | ||
IHierarchical, | ||
"gemini", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.schema< | ||
IReference, | ||
"gemini", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.schema< | ||
IHierarchical, | ||
"gemini", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); | ||
typia.llm.schema< | ||
IReference, | ||
"gemini", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); | ||
|
||
// PARAMETERS | ||
typia.llm.parameters< | ||
{ | ||
x: IHierarchical; | ||
}, | ||
"gemini", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.parameters< | ||
{ | ||
x: IReference; | ||
}, | ||
"gemini", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.parameters< | ||
{ | ||
x: IHierarchical; | ||
}, | ||
"gemini", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); | ||
typia.llm.parameters< | ||
{ | ||
x: IReference; | ||
}, | ||
"gemini", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); | ||
|
||
// APPLICATION | ||
typia.llm.application< | ||
{ | ||
insert(props: { x: IHierarchical }): void; | ||
}, | ||
"gemini", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.application< | ||
{ | ||
insert(props: { x: IReference }): void; | ||
}, | ||
"gemini", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.application< | ||
{ | ||
insert(props: { x: IHierarchical }): void; | ||
}, | ||
"gemini", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); | ||
typia.llm.application< | ||
{ | ||
insert(props: { x: IReference }): void; | ||
}, | ||
"gemini", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); |
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 |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import typia from "typia"; | ||
|
||
interface IHierarchical { | ||
children: IHierarchical[]; | ||
} | ||
interface IReference { | ||
parent: IReference | null; | ||
} | ||
|
||
// SCHEMA | ||
typia.llm.schema< | ||
IHierarchical, | ||
"3.0", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.schema< | ||
IReference, | ||
"3.0", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.schema< | ||
IHierarchical, | ||
"3.0", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); | ||
typia.llm.schema< | ||
IReference, | ||
"3.0", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); | ||
|
||
// PARAMETERS | ||
typia.llm.parameters< | ||
{ | ||
x: IHierarchical; | ||
}, | ||
"3.0", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.parameters< | ||
{ | ||
x: IReference; | ||
}, | ||
"3.0", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.parameters< | ||
{ | ||
x: IHierarchical; | ||
}, | ||
"3.0", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); | ||
typia.llm.parameters< | ||
{ | ||
x: IReference; | ||
}, | ||
"3.0", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); | ||
|
||
// APPLICATION | ||
typia.llm.application< | ||
{ | ||
insert(props: { x: IHierarchical }): void; | ||
}, | ||
"3.0", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.application< | ||
{ | ||
insert(props: { x: IReference }): void; | ||
}, | ||
"3.0", | ||
{ | ||
recursive: false; | ||
} | ||
>(); | ||
typia.llm.application< | ||
{ | ||
insert(props: { x: IHierarchical }): void; | ||
}, | ||
"3.0", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); | ||
typia.llm.application< | ||
{ | ||
insert(props: { x: IReference }): void; | ||
}, | ||
"3.0", | ||
{ | ||
recursive: 0; | ||
} | ||
>(); |