-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Limit IHttpLlmFunction.description
length under 1,024.
#124
Merged
Conversation
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
As OpenAI (ChatGPT) does not allow over 1,024 length description property on the tool calling's function definition, `@samchon/openapi` also blocks it on the `IHttpLlmApplication` composing process. In the same way, `typia.llm.application<App, Model>()` and `typia.llm.applicationOfValidate<App, Model>()` functions will block the 1,024 length over description too.
samchon
commented
Jan 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test OK.
samchon
added a commit
to samchon/typia
that referenced
this pull request
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.
samchon
added a commit
to samchon/typia
that referenced
this pull request
Jan 13, 2025
Yradex
pushed a commit
to Yradex/lynx-stack
that referenced
this pull request
Mar 4, 2025
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [typia](https://typia.io) ([source](https://github.com/samchon/typia)) | [`7.5.1` -> `7.6.3`](https://renovatebot.com/diffs/npm/typia/7.5.1/7.6.3) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>samchon/typia (typia)</summary> ### [`v7.6.3`](https://github.com/samchon/typia/releases/tag/v7.6.3) [Compare Source](https://github.com/samchon/typia/compare/b7ddefa4414df2e69dd844b5619721e4513bbe78...v7.6.3) #### What's Changed - Fix [#​1486](https://github.com/samchon/typia/issues/1486): object alias type case in LLM. by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1487](https://github.com/samchon/typia/pull/1487) - Fix wrong function name in the compilation error messages. by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1488](https://github.com/samchon/typia/pull/1488) **Full Changelog**: samchon/typia@v7.6.1...v7.6.3 ### [`v7.6.2`](https://github.com/samchon/typia/compare/v7.6.1...b7ddefa4414df2e69dd844b5619721e4513bbe78) [Compare Source](https://github.com/samchon/typia/compare/v7.6.1...b7ddefa4414df2e69dd844b5619721e4513bbe78) ### [`v7.6.1`](https://github.com/samchon/typia/releases/tag/v7.6.1) [Compare Source](https://github.com/samchon/typia/compare/v7.6.0...v7.6.1) #### What's Changed - Docs: fix wrong configured tsconfig.json at setup document by [@​sunrabbit123](https://github.com/sunrabbit123) in [https://github.com/samchon/typia/pull/1461](https://github.com/samchon/typia/pull/1461) - Fix [samchon/nestia#1063](https://github.com/samchon/nestia/issues/1063): no `@default` comment tag support. by @​samch[https://github.com/samchon/typia/pull/1464](https://github.com/samchon/typia/pull/1464)l/1464 - fix typo by [@​ryoppippi](https://github.com/ryoppippi) in [https://github.com/samchon/typia/pull/1465](https://github.com/samchon/typia/pull/1465) - Benchmark [#​1455](https://github.com/samchon/typia/issues/1455): measure on Bun.JS by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1471](https://github.com/samchon/typia/pull/1471) - Close [#​1470](https://github.com/samchon/typia/issues/1470): upgrade eslint by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1472](https://github.com/samchon/typia/pull/1472) - fix build for esm by [@​ryoppippi](https://github.com/ryoppippi) in [https://github.com/samchon/typia/pull/1467](https://github.com/samchon/typia/pull/1467) - include tsconfig and rollup in workflow triggers by [@​ryoppippi](https://github.com/ryoppippi) in [https://github.com/samchon/typia/pull/1469](https://github.com/samchon/typia/pull/1469) - Introduce how to build A.I. chatbot by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1474](https://github.com/samchon/typia/pull/1474) - Enhance `/docs/llm/chat` content. by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1475](https://github.com/samchon/typia/pull/1475) - Assign titles for each website document by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1476](https://github.com/samchon/typia/pull/1476) - Purify the expression, A.I. chatbot can replace GUI applications. by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1478](https://github.com/samchon/typia/pull/1478) - Benchmark on server processor: NodeJS versus Bun by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1479](https://github.com/samchon/typia/pull/1479) - feat: add GitHub Actions CI workflow for code quality by [@​ryoppippi](https://github.com/ryoppippi) in [https://github.com/samchon/typia/pull/1480](https://github.com/samchon/typia/pull/1480) - chore(gitignore): add bun.lock by [@​ryoppippi](https://github.com/ryoppippi) in [https://github.com/samchon/typia/pull/1482](https://github.com/samchon/typia/pull/1482) - Update typedoc-github-theme requirement from ^0.2.0 to ^0.2.1 in /website in the ecosystem group across 1 directory by [@​dependabot](https://github.com/dependabot) in [https://github.com/samchon/typia/pull/1460](https://github.com/samchon/typia/pull/1460) - fix spelling ci & fix typo by [@​ryoppippi](https://github.com/ryoppippi) in [https://github.com/samchon/typia/pull/1481](https://github.com/samchon/typia/pull/1481) - Bump up `@samchon/openapi` version. by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1485](https://github.com/samchon/typia/pull/1485) **Full Changelog**: samchon/typia@v7.6.0...v7.6.1 ### [`v7.6.0`](https://github.com/samchon/typia/releases/tag/v7.6.0) [Compare Source](https://github.com/samchon/typia/compare/v7.5.1...v7.6.0) #### What's Changed - Detailed documentation about `typia.llm.application()` function by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1443](https://github.com/samchon/typia/pull/1443) - Update typedoc requirement from ^0.27.5 to ^0.27.6 in /website in the ecosystem group by [@​dependabot](https://github.com/dependabot) in [https://github.com/samchon/typia/pull/1446](https://github.com/samchon/typia/pull/1446) - Update [@​samchon/openapi](https://github.com/samchon/openapi) requirement from ^2.3.0 to ^2.3.1 in the ecosystem group by [@​dependabot](https://github.com/dependabot) in [https://github.com/samchon/typia/pull/1444](https://github.com/samchon/typia/pull/1444) - Detailed description of `typia.llm.parameters()` function. by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1450](https://github.com/samchon/typia/pull/1450) - Develop [samchon/openapi#124](https://github.com/samchon/openapi/issues/124) and [samchon/openapi#125](https://github.com/samchon/openapi/issues/125). by [@​samchon](https://github.com/samchon) in [https://github.com/samchon/typia/pull/1459](https://github.com/samchon/typia/pull/1459) **Full Changelog**: samchon/typia@v7.5.1...v7.6.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/lynx-wg/lynx-stack). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMjUuMSIsInVwZGF0ZWRJblZlciI6IjM5LjE0NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Qingyu Wang <colinwang.0616@gmail.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As OpenAI (ChatGPT) does not allow over 1,024 length description property on the tool calling's function definition,
@samchon/openapi
also blocks it on theIHttpLlmApplication
composing process.In the same way,
typia.llm.application<App, Model>()
andtypia.llm.applicationOfValidate<App, Model>()
functions will block the 1,024 length over description too.This pull request includes several changes to improve the handling of descriptions and validation in the
HttpLlmApplicationComposer
and related test files, as well as updates to JSON schema files. The most important changes include the addition of description length validation, reordering of JSON schema properties, and updates to test cases.Improvements to description handling and validation:
src/composers/HttpLlmApplicationComposer.ts
: Added logic to handle operation descriptions, ensuring they are properly formatted and do not exceed 1024 characters. If the description is too long, an error is added toprops.errors
. [1] [2] [3] [4]Updates to JSON schema files:
examples/function-calling/schemas/claude.sale.schema.json
: Reordered therequired
property for units to ensure it appears after thename
property. [1] [2] [3]Test case updates:
test/features/llm/chatgpt/test_chatgpt_function_calling_description_length.ts
: Added a new test case to validate that descriptions do not exceed 1024 characters.test/features/llm/chatgpt/test_chatgpt_function_calling_name_length.ts
: Added a new test case to validate function names with a maximum length of 64 characters.test/features/llm/chatgpt/test_chatgpt_function_calling_additionalProperties.ts
test/features/llm/chatgpt/test_chatgpt_function_calling_example.ts
test/features/llm/chatgpt/test_chatgpt_function_calling_optional.ts
test/features/llm/chatgpt/test_chatgpt_function_calling_recursive.ts
test/features/llm/chatgpt/test_chatgpt_function_calling_union.ts
test/features/llm/claude/test_claude_function_calling_additionalProperties.ts
Other changes:
package.json
: Updated the version number from2.3.4
to2.4.0
.