MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / _gen_create

Function _gen_create

openkb/agent/compiler.py:1811–1836  ·  view source on GitHub ↗
(concept: dict)

Source from the content-addressed store, hash-verified

1809 semaphore = asyncio.Semaphore(max_concurrency)
1810
1811 async def _gen_create(concept: dict) -> tuple[str, str, bool, str]:
1812 name = concept["name"]
1813 title = concept.get("title", name)
1814 async with semaphore:
1815 raw = await _llm_call_page_async(
1816 model,
1817 [
1818 system_msg,
1819 doc_msg, # cached (BP1)
1820 summary_msg, # cached (BP2)
1821 known_targets_msg, # cached (BP3) — whitelist
1822 {
1823 "role": "user",
1824 "content": _CONCEPT_PAGE_USER.format(
1825 title=title,
1826 doc_name=doc_name,
1827 update_instruction="",
1828 ),
1829 },
1830 ],
1831 f"concept: {name}",
1832 response_format=_JSON_RESPONSE_FORMAT,
1833 )
1834 brief, content, _ = _page_fields(raw)
1835 _require_nonempty_content(content, name)
1836 return name, content, False, brief
1837
1838 async def _gen_update(concept: dict) -> tuple[str, str, bool, str]:
1839 name = concept["name"]

Callers 1

_compile_conceptsFunction · 0.85

Calls 4

_llm_call_page_asyncFunction · 0.85
_page_fieldsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected