Buckets:

download
raw
707 Bytes
import asyncio
from pydantic import BaseModel
from typing import List
from cognee.infrastructure.llm.LLMGateway import LLMGateway
class MiniEntity(BaseModel):
name: str
type: str
class MiniGraph(BaseModel):
nodes: List[MiniEntity]
async def main():
system_prompt = (
"Extract entities as nodes with name and type. "
"Use concise, literal values present in the text."
)
text = "Apple develops iPhone; Audi produces the R8."
result = await LLMGateway.acreate_structured_output(text, system_prompt, MiniGraph)
print(result)
# MiniGraph(nodes=[MiniEntity(name='Apple', type='Organization'), ...])
if __name__ == "__main__":
asyncio.run(main())

Xet Storage Details

Size:
707 Bytes
·
Xet hash:
77445a53da13285cbfc3b3e3c2861de0751e4129219a4fc9d996055029411dc6

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.