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

I cannot build my Typescript project when using v3.0.0 #349

Closed
5 tasks
vlamanna opened this issue Sep 27, 2024 · 2 comments · Fixed by #351
Closed
5 tasks

I cannot build my Typescript project when using v3.0.0 #349

vlamanna opened this issue Sep 27, 2024 · 2 comments · Fixed by #351
Assignees
Labels
bug Something isn't working released

Comments

@vlamanna
Copy link

Issue description

I cannot build my Typescript project when using v3.0.0

Expected Behavior

My project build.

Actual Behavior

I'm getting the following error:

node_modules/node-llama-cpp/dist/chatWrappers/Llama3_1ChatWrapper.d.ts:12:72 - error TS2339: Property '_specialTokensTextForPreamble' does not exist on type '{ cuttingKnowledgeDate?: string | number | Date | (() => Date) | null | undefined; todayDate?: string | number | Date | (() => Date) | null | undefined; noToolInstructions?: boolean | undefined; }'.

12     constructor({ cuttingKnowledgeDate, todayDate, noToolInstructions, _specialTokensTextForPreamble }?: {

It was fine when I was using the beta version.

Steps to reproduce

  • Install package in a Typescript project
  • Build the project

My Environment

Dependency Version
Operating System MacOS
CPU Apple M1
Node.js version 20.16.0
Typescript version 5.5.2
node-llama-cpp version 3.0.0

Additional Context

I have a PR ready that I will push shortly.

Relevant Features Used

  • Metal support
  • CUDA support
  • Vulkan support
  • Grammar
  • Function calling

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, and I know how to start.

@vlamanna vlamanna added bug Something isn't working requires triage Requires triaging labels Sep 27, 2024
vlamanna added a commit to vlamanna/node-llama-cpp that referenced this issue Sep 27, 2024
Fix the type mismatch in the Llama3_1ChatWrapper constructor.

Fix issue withcatai#349
@giladgd giladgd self-assigned this Sep 29, 2024
@giladgd giladgd removed the requires triage Requires triaging label Sep 29, 2024
@giladgd
Copy link
Contributor

giladgd commented Sep 29, 2024

@vlamanna I fixed the issue you're facing in #351 by making sure that _specialTokensTextForPreamble will not appear in the transpiled ts types.

However, I couldn't reproduce this issue on my machine.
Scaffolding a project using the npm create node-llama-cpp@latest command works on my machine and runs as expected.
Even calling npx tsc works as expected.

Can you please share with me what's your tsconfig.json?
If you can figure out what's different between your project and the scaffolded project from the npm create node-llama-cpp@latest command that causes this issue, it would be very helpful for me so I can add some kind of safeguards to ensure this doesn't happen again.

Copy link

github-actions bot commented Oct 5, 2024

🎉 This issue has been resolved in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
2 participants