Llm api zero few shot prompting
Skill kjuhwa/skills-hub/skills/llm-agents/llm-api-zero-few-shot-prompting
Self-correcting knowledge corpus for Claude Code — 9 stable shape clusters, bias-correction pipeline baked into contribution flow. 47 papers, 45 techniques, 1.1k skills.
npx -y skills add kjuhwa/skills-hub --skill llm-api-zero-few-shot-promptingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Call Qwen (DashScope) or OpenAI APIs for zero-shot and few-shot prompting, including streaming responses.
SKILL.md
1.8 KB, 327 tokens by cl100k_base, as published. Nobody here has run it
LLM API Zero-Shot and Few-Shot Prompting
When to use
- Call a hosted LLM API without training (Qwen/DashScope, OpenAI, Zhipu).
- Zero-shot (instruction only) or few-shot (labeled examples + instruction) prompting.
- Streaming output for real-time display.
Steps
-
Register and get API key:
- Qwen/DashScope: https://help.aliyun.com/zh/dashscope/developer-reference/quick-start
- Zhipu AI: https://open.bigmodel.cn/
-
Install SDK:
pip install dashscope
- Standard call:
import dashscope
from http import HTTPStatus
resp = dashscope.Generation.call(
model='qwen-turbo',
prompt='Give me a recipe using carrots and potatoes.'
)
if resp.status_code == HTTPStatus.OK:
print(resp.output)
- Streaming call:
response_generator = dashscope.Generation.call(
model='qwen-turbo',
prompt='Explain quantum entanglement simply.',
stream=True,
top_p=0.8
)
for resp in response_generator:
print(resp.output['text'], end='')
- For few-shot prompting, prepend labeled examples before the target query.
Pitfalls
- OpenAI requires VPN in China; prefer DashScope (Qwen) or Zhipu.
Source
- Chapter 2 of dive-into-llms - documents/chapter2/README.md