feat: support server side auto embedding#159
Merged
Conversation
There was a problem hiding this comment.
Bugbot free trial expires on July 29, 2025
Learn more in the Cursor dashboard.
…formatting - Changed `VectorType(dimensions)` to `VECTOR(dimensions)` for consistency. - Updated the query string formatting to use backticks around `source_field` in the `Computed` function.
🚨 Bugbot Trial ExpiredYour Bugbot trial has expired. Please purchase a license in the Cursor dashboard to continue using Bugbot. |
Bugbot found 3 bugsTo see them, activate your membership in your Cursor dashboard. |
…sing get_model_dimensions
…to_embedding for dynamic model configuration
Member
|
Just curious, for this example, what will happen if I don't keep the For example, by using like this: from app.db import tidb_client
from pytidb.embeddings import EmbeddingFunction
from pytidb.schema import TableModel, Field
# Set API key globally
tidb_client.configure_embedding_provider("openai", os.getenv("OPENAI_API_KEY"))
# Define table schema with auto embedding config.
class Chunk(TableModel):
id: int = Field(primary_key=True)
text: str = Field()
text_vec: Optional[list[float]] = EmbeddingFunction("openai/text-embedding-3-small").VectorField(source_field="text")
# Create table
tbl = tidb_client.create_table(schema=Chunk, if_exists="overwrite")
# Insert data
tbl.insert(Chunk(id=1, text="foo"))
# Search
results = tbl.search("bar").limit(1).to_pydantic(with_score=True)Will there be any downsides? Seems like in this way the EmbeddingFunction could more bounded with the Schema. Also, when user wants two tables, do they need to define two embedding functions or they can reuse one? |
…bedding for jina_ai model configuration
This was referenced Aug 11, 2025
Closed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
After this PR, server-side auto embedding will be enabled by default for EmbeddingFunction. Embeddings will be computed automatically on the database side.
Currently, server-side auto embedding has a few limitations:
Usage Example
By default, EmbeddingFunction uses server-side automatic embedding:
However, TiDB Serverless currently does not support multimodal inputs, so for multimodal embedding models, client-side embedding should be used instead.
To indicate that the embedding model supports multimodal input, set
multimodal=True:Example Integration with TableModel: