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

refactor: prompt system #1154

Merged
merged 10 commits into from
Sep 6, 2024

Conversation

himself65
Copy link
Member

@himself65 himself65 commented Sep 5, 2024

Related issue: #739

  1. type safe, will even check string template include {str}
  2. python template string compatible
  3. same API with PromptTemplate and BaseTemplate...

Copy link

changeset-bot bot commented Sep 5, 2024

🦋 Changeset detected

Latest commit: b8dc81a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
llama-index-ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 6, 2024 6:07pm

Copy link

pkg-pr-new bot commented Sep 6, 2024

Open in Stackblitz

@llamaindex/autotool

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/autotool@1154

@llamaindex/cloud

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/cloud@1154

@llamaindex/core

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/core@1154

@llamaindex/community

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/community@1154

@llamaindex/experimental

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/experimental@1154

@llamaindex/env

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/env@1154

llamaindex

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/llamaindex@1154

@llamaindex/wasm-tools

pnpm add https://pkg.pr.new/run-llama/LlamaIndexTS/@llamaindex/wasm-tools@1154

commit: b8dc81a

@himself65 himself65 merged commit 0148354 into run-llama:main Sep 6, 2024
17 checks passed
@himself65 himself65 deleted the himself65/20240905/prompt-system branch September 6, 2024 20:28
@@ -132,7 +146,8 @@
"devDependencies": {
"ajv": "^8.17.1",
"bunchee": "5.3.2",
"natural": "^8.0.1"
"natural": "^8.0.1",
"python-format-js": "^1.4.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

@himself65 I think that the python-format-js should be in dependencies and not in devDependencies.

I'm saying this because it's being used at packages/core/src/prompts/base.ts.

Can you please confirm?

Copy link
Member Author

Choose a reason for hiding this comment

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

I intentionally use dev dep to let bundler to inline the code

Copy link
Contributor

Choose a reason for hiding this comment

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

@himself65 apologies, my initial comment was probably misleading due to lack of context

I'm developing a next-based app and after bumping llamaindex I started to see the following error:

⨯ TypeError: Cannot redefine property: format
at Function.defineProperty ()
at eval (webpack-internal:///(rsc)/../../node_modules/@llamaindex/core/dist/prompts/index.js:28:8)
at (rsc)/../../node_modules/@llamaindex/core/dist/prompts/index.js (apps/web/.next/server/vendor-chunks/@llamaindex.js:80:1)
at webpack_require (apps/web/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/../../node_modules/llamaindex/dist/index.edge.js:222:82)
at (rsc)/../../node_modules/llamaindex/dist/index.edge.js (apps/web/.next/server/vendor-chunks/llamaindex.js:560:1)

so I assumed that this was the source of the problem.

However, now that I'm investigating a little bit more I'm seeing that problem does not come from this PR. It's something else.

Apologies for tagging you and thank you for quick reply

@@ -0,0 +1,225 @@
import format from "python-format-js";
Copy link
Contributor

Choose a reason for hiding this comment

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

@himself65 this is where python-format-js is being imported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants