github samchon/typia v7.0.0

latest releases: v7.5.1, v7.5.0, v7.4.2...
22 days ago

LLM Models Supporting

LLM schema generator functions have become suitable to LLM provider models.

import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
import typia from "typia";

const app: ILlmApplication<"chatgpt"> = typia.llm.application<MyApp, "chatgpt">();
const parameters: ILlmSchema.IParameters<"claude"> = typia.llm.parameters<MyParameters, "claude">();
const schema: ILlmSchema<"gemini"> = typia.llm.schema<MyType, "gemini">();
image

Optimized for Frontend Bundlers

Typia v7 compiler has been optimized for frontend bundlers.

From now on, internal functions would be dynamically imported like below.

cc @ryoppippi: please check unplugin-typia works in the new major update.

import typia, { tags } from "typia";
import { v4 } from "uuid";

const matched: boolean = typia.is<IMember>({
  id: v4(),
  email: "samchon.github@gmai19l.com",
  age: 30,
});

console.log(matched); // true

interface IMember {
  id: string & tags.Format<"uuid">;
  email: string & tags.Format<"email">;
  age: number &
    tags.Type<"uint32"> &
    tags.ExclusiveMinimum<19> &
    tags.Maximum<100>;
}
import * as __typia_transform__isFormatUuid from "typia/lib/internal/_isFormatUuid.js";
import * as __typia_transform__isFormatEmail from "typia/lib/internal/_isFormatEmail.js";
import * as __typia_transform__isTypeUint32 from "typia/lib/internal/_isTypeUint32.js";
import typia from "typia";
import { v4 } from "uuid";
const matched = (() => {
  const _io0 = (input) =>
    "string" === typeof input.id &&
    __typia_transform__isFormatUuid._isFormatUuid(input.id) &&
    "string" === typeof input.email &&
    __typia_transform__isFormatEmail._isFormatEmail(input.email) &&
    "number" === typeof input.age &&
    __typia_transform__isTypeUint32._isTypeUint32(input.age) &&
    19 < input.age &&
    input.age <= 100;
  return (input) => "object" === typeof input && null !== input && _io0(input);
})()({
  id: v4(),
  email: "samchon.github@gmai19l.com",
  age: 30,
});
console.log(matched); // true

What's Changed

Full Changelog: v6.12.2...v7.0.0

Don't miss a new typia release

NewReleases is sending notifications on new releases.