소스 정보
- 저장소
- NPC-Worldwide/npcsh
- 최근 소스 활동
- 2026년 7월 22일 02:16
- 감지된 SKILL.md 언어
- 영어
- 스타
- 472
- 포크
- 31
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/NPC-Worldwide/npcsh --skill npcpy-prompting명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | npcpy-prompting |
| description | npcpy LLM prompting and JSON formatting patterns. |
| source_jinx | npcsh/npc_team/jinxes/skills/npcpy-prompting.jinx |
| engine | skill |
npcpy LLM prompting and JSON formatting patterns.
Always import at module level:
from npcpy.llm_funcs import get_llm_responsefrom npcpy.npc_compiler import NPCfrom npcpy.gen.response import get_litellm_response (only for streaming)get_llm_response(prompt, model, provider, **kwargs) — first arg is POSITIONAL.
Do NOT write prompt=prompt. Do NOT use NPC.call(). The function is module-level.
Pass format="json" for structured output.
npcpy parses internally. Access via response["response"].
Never call json.loads() manually.
Create an NPC to hold model, provider, and primary_directive.
Pass it as npc=npc_instance so npcpy reads those values:
npc = NPC(name="...", primary_directive="...", model="...", provider="...")
response = get_llm_response(prompt, npc=npc, format="json", temperature=0.7)
data = response["response"]
Pass conversation history as messages=[{"role": "system", "content": msg}].
This is a kwarg like any other. It does not persist between calls.
Sampling kwargs to get_llm_response:
temperature, top_p, top_k, max_tokensstream=True returns a generator in response["response"]For token-level streaming use get_litellm_response with stream=True.
For segment-level use get_llm_response(..., stream=True) and iterate response["response"].
json.loads(response["response"]).response.get("response") and then parse it again.response is a string when format="json" is used.When constructing prompt strings in Python:
f"""...""" for all multiline prompts. Do NOT use implicit string concatenation.return statement. Assign to a variable first, then return it.""" must be at the same indentation as the variable assignment.{{ inside f-strings. If you need literal curly braces in the prompt output, use explicit string concatenation:
prompt = f"""Write a JSON response like this:""" + """\n{'key': 'value'}\n"""
f"..." f"..." on adjacent lines or in parentheses expecting the parser to concatenate them.