Files
AI/참고/neo4j-graphrag-python-main/examples/customize/llms/ollama_llm.py

14 lines
414 B
Python
Raw Normal View History

2026-05-12 19:40:31 +09:00
"""This example demonstrate how to invoke an LLM using a local model
served by Ollama.
"""
from neo4j_graphrag.llm import LLMResponse, OllamaLLM
with OllamaLLM(
model_name="<model_name>",
# model_params={"options": {"temperature": 0}, "format": "json"},
# host="...", # if using a remote server
) as llm:
res: LLMResponse = llm.invoke("What is the additive color model?")
print(res.content)