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

feat: truncate embedding tokens #918

Merged
merged 7 commits into from
Jun 14, 2024
Merged

Conversation

marcusschiesser
Copy link
Collaborator

@marcusschiesser marcusschiesser commented Jun 10, 2024

  • truncate text to embed before sending it to OpenAI

Copy link

vercel bot commented Jun 10, 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 Jun 14, 2024 6:11pm

Copy link

changeset-bot bot commented Jun 10, 2024

🦋 Changeset detected

Latest commit: a3694dd

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

This PR includes changesets to release 9 packages
Name Type
llamaindex Patch
docs Patch
@llamaindex/community Patch
@llamaindex/experimental Patch
@llamaindex/cloudflare-worker-agent-test Patch
@llamaindex/next-agent-test Patch
@llamaindex/nextjs-edge-runtime-test Patch
@llamaindex/waku-query-engine-test Patch
@llamaindex/autotool-02-next-example Patch

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

@@ -109,6 +123,16 @@ export class OpenAIEmbedding extends BaseEmbedding {
* @param options
*/
private async getOpenAIEmbedding(input: string[]): Promise<number[][]> {
Copy link
Member

Choose a reason for hiding this comment

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

this is not a good solution.

This will break the return type of getTextEmbedding('large chunk')

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

doesn't getTextEmbedding('large chunk') - it just ensures that getTextEmbedding('large chunk') is not throwing an exception

@himself65
Copy link
Member

let me ignore waku for now, it might be their issue

@himself65 himself65 merged commit a44e54f into main Jun 14, 2024
16 checks passed
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.

None yet

2 participants