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

Develop samchon/openapi#124 and samchon/openapi#125. #1459

Merged
merged 2 commits into from
Jan 13, 2025
Merged

Conversation

samchon
Copy link
Owner

@samchon samchon commented Jan 13, 2025

As OpenAI (ChatGPT) restricts function name and description lengths (64 and 1,024), @samchon/openapi's HttpLlm.application() function converting OpenAPI document to LLM function calling application has adopted it.

Therefore, this PR makes typia to occur compilation error when 64 length over function name comes, or 1,024 length over descripted function comes.

Also, typia has allowed empty parameterized functions in the typia.llm.application() function.


This pull request includes several updates to dependencies and improvements in the codebase. The most important changes include updating the typescript version across multiple package.json files, adding and modifying functions in the JsonApplicationProgrammer and LlmApplicationProgrammer namespaces, and introducing new test cases.

Dependency updates:

  • Updated typescript version from ~5.7.2 to ~5.7.3 in multiple package.json files, including benchmark/package.json [1] package.json [2] test-error/package.json [3] test-esm/package.json [4] test/package.json [5] and website/package.json [6].

Function additions and modifications:

  • Added writeDescription function to JsonApplicationProgrammer namespace and removed the previous implementation [1] [2].
  • Modified LlmApplicationOfValidateProgrammer to handle null parameters and added a fallback for writeValidadtor when parameter is null [1] [2].
  • Renamed variables in LlmApplicationProgrammer for clarity and added validation for function descriptions and names [1] [2] [3] [4] [5].

New test cases:

  • Added new test cases in test-error/src/llm/llm.application.length.ts to validate LLM application length constraints.
  • Added a new test case in test/src/debug/llm.ts to validate LLM application.

As OpenAI (ChatGPT) restricts function name and description lengths (64 and 1,024), `@samchon/openapi`'s `HttpLlm.application()` function converting OpenAPI document to LLM function calling application has adopted it.

Therefore, this PR makes `typia` to occur compilation error when 64 length over function name comes, or 1,024 length over descripted function comes.

Also, `typia` has allowed empty parameterized functions in the `typia.llm.application()` function.
@samchon samchon added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 13, 2025
@samchon samchon self-assigned this Jan 13, 2025
Copy link

pkg-pr-new bot commented Jan 13, 2025

Open in Stackblitz

npm i https://pkg.pr.new/typia@1459

commit: e62aa2c

Copy link

socket-security bot commented Jan 13, 2025

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@fastify/[email protected] None 0 25.5 kB matteo.collina
npm/@sinclair/[email protected] None 0 536 kB sinclair
npm/@trivago/[email protected] Transitive: environment, eval, filesystem, unsafe +34 12.5 MB ayusharma
npm/@typegoose/[email protected] environment Transitive: eval, filesystem, network +101 15.6 MB hasezoey
npm/@types/[email protected] None 0 21.9 kB types
npm/@types/[email protected] None 0 9.24 kB types
npm/@types/[email protected] None 0 5.1 kB types
npm/@types/[email protected] None +1 2.3 MB types
npm/@types/[email protected] None +1 2.37 MB types
npm/@types/[email protected] None 0 3.23 kB types
npm/@types/[email protected] None 0 6.67 kB types
npm/@types/[email protected] None 0 6.74 kB types
npm/@typescript-eslint/[email protected] Transitive: environment, eval, filesystem, unsafe +97 15.3 MB jameshenry
npm/@typescript-eslint/[email protected] Transitive: environment, eval, filesystem, unsafe +90 12.1 MB jameshenry
npm/[email protected] environment, filesystem, network, shell Transitive: eval, unsafe +34 2.92 MB matteo.collina
npm/[email protected] eval +1 138 kB jdalton
npm/[email protected] None 0 776 kB typestack-release-bot
npm/[email protected] None +3 14.3 MB typestack-release-bot
npm/[email protected] environment Transitive: filesystem +12 253 kB cohara87
npm/[email protected] 🔁 npm/[email protected] Transitive: filesystem, network, shell +35 4.01 MB mbostock
npm/[email protected] Transitive: environment, eval, filesystem, unsafe +96 13.4 MB gund
npm/[email protected] eval +5 622 kB jsumners
npm/[email protected] Transitive: environment, eval, filesystem +39 4.99 MB eomm
npm/[email protected] None +1 5.2 MB gcanti
npm/[email protected] eval, filesystem, network, shell, unsafe Transitive: environment +46 7.7 MB domenic
npm/[email protected] shell 0 3.14 kB seb
npm/[email protected] environment, filesystem, unsafe 0 11.2 MB prettier-bot
npm/[email protected] filesystem, network +11 3 MB google-wombot
npm/[email protected] None 0 295 kB rbuckton
npm/[email protected] filesystem +2 895 kB linusu
npm/[email protected] Transitive: network +4 695 kB samchon
npm/[email protected] environment, filesystem +20 890 kB nonara
npm/[email protected] None 0 2.58 MB samchon
npm/[email protected] None 0 123 kB ctavan
npm/[email protected] None 0 0 B

🚮 Removed packages: npm/@emotion/[email protected], npm/@emotion/[email protected], npm/@monaco-editor/[email protected], npm/@mui/[email protected], npm/@mui/[email protected], npm/@rollup/[email protected], npm/@rspack/[email protected], npm/@rspack/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Copy link

socket-security bot commented Jan 13, 2025

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Critical CVE npm/@babel/[email protected] ⚠︎

View full report↗︎

Next steps

What is a critical CVE?

Contains a Critical Common Vulnerability and Exposure (CVE).

Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

Copy link
Owner Author

@samchon samchon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test OK.

@samchon samchon merged commit 58ffcf8 into master Jan 13, 2025
9 checks passed
@samchon samchon deleted the feat/separate branch January 13, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
No open projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant