Skip to content

v0.0.13

Choose a tag to compare

@Mini256 Mini256 released this 29 Aug 03:10
· 18 commits to main since this release
686ea92

✨ What's New

  • Make pytidb compatible with TiDB v8.5 #171 by @Mini256

  • EmbeddingFunction support dimensions config for server-side embedding #184 by @Mini256

    embed_fn = EmbeddingFunction(model_name="text-embedding-3-small", dimensions=1024)

    You can use this parameter to reduce the dimensionality of the vectors generated by the embedding model, which can reduce the storage consumption and improve the query efficiency of the vector search to some extent.

  • table.search() API and support returning Relationship Field #180 by @Mini256

    For example:

    class Entity(TableModel):
        __tablename__ = "entities"
        id: int = Field(primary_key=True)
        name: str = Field()
    
     entity_table = db.create_table(schema=Entity, if_exists="skip")
    
      class Relation(TableModel):
          __tablename__ = "relations"
          id: int = Field(primary_key=True)
          description: str = Field()
          source_entity_id: int = Field(foreign_key="entities.id")
          target_entity_id: int = Field(foreign_key="entities.id")
          embedding: list[float] = text_embed.VectorField(source_field="description")
          source_entity: Entity = Relationship(
              sa_relationship_kwargs={ "primaryjoin": "Relation.source_entity_id == Entity.id", "lazy": "joined" },
          )
          target_entity: Entity = Relationship(
              sa_relationship_kwargs={ "primaryjoin": "Relation.target_entity_id == Entity.id", "lazy": "joined" },
          )
    
    relation_table = db.create_table(schema=Relation, if_exists="skip")

    Now, relation_table.search("xxxx").limit(1).to_pydantic(); will return the source_entity, and target_entity field, it will help you build GraphRAG application with fewer lines of code.

📝 Documentation & Examples

🧰 Refactor

  • Move table creation logic out of Table constructor #169 by @Mini256
    Init table = Table(schema=TableModel) will no create the table in database, using table.create() or db.create_table(schema=TableModel) instead.

🔗 Full Changelog: v0.0.12...v0.0.13