用于 NLP、多模态 LLM、智能体、ML、知识图谱等领域的研究和开发的 Python 库。
# npcpy
`npcpy` 是一款库,为多模态语言模型、代理式 AI 和知识图谱的研究和开发提供了关键的基础模块。其灵活的框架使得开发强大的 AI 应用变得更加容易,支持本地 (如 `ollama`、`LLaMA.cpp`、`omlx`、`LM Studio`) 和云提供商。通过 NPC Context-Agent-Tool 数据层构建多代理团队,并简化上下文工程,该数据层通过软件而不是提示来确保符合性。 ```bash pip install npcpy ``` ## 简单示例 ### 创建和使用角色 ```python from npcpy import NPC
simon = NPC( name='Simon Bolivar', primary_directive=''' Liberate South America from the Spanish Royalists. ''', model='qwen3.5:9b', provider='ollama' ) response = simon.get_llm_response("What is the most important territory to retain in the Andes?") print(response['response'])
…
### 直接调用 LLM
```python
from npcpy import get_llm_response
response = get_llm_response("Who was the celtic god that helped cuchulainn in his time of need as the forces of medb descended upon the men of ulster?", model='gemma4:31b', provider='ollama')
print(response['response'])Cú Chulainn was primarily aided by his divine father, the god Lugh, and his foster-father, the warrior-god Fergus mac Róich, as well as the magical support of his teacher Scáthach.使用 OrcaRouter 尝试 15 个不同提供商的近 200 种不同模型,请使用我们的 推荐链接!
暂无开放 Issues,或尚未同步最近议题。