Fixes #2349 custom code rag instructions
This commit is contained in:
parent
455ca6bde0
commit
bccb178c8f
1 changed files with 2 additions and 1 deletions
|
|
@ -37,6 +37,7 @@ With LanceDB, we can do steps 2 and 3 simultaneously, as demonstrated [in their
|
|||
```python
|
||||
from lancedb.pydantic import LanceModel, Vector
|
||||
from lancedb.embeddings import get_registry
|
||||
from typing import List
|
||||
|
||||
db = lancedb.connect("/tmp/db")
|
||||
func = get_registry().get("openai").create(
|
||||
|
|
@ -48,7 +49,7 @@ func = get_registry().get("openai").create(
|
|||
class CodeChunks(LanceModel):
|
||||
filename: str
|
||||
text: str = func.SourceField()
|
||||
vector: Vector(func.ndims()) = func.VectorField()
|
||||
vector: List[float] = func.VectorField()
|
||||
|
||||
table = db.create_table("code_chunks", schema=CodeChunks, mode="overwrite")
|
||||
table.add([
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue