Agent skill
llm
Generate text, call tools, and get structured JSON output using LLM providers (Claude, OpenAI, Gemini, Ollama). Use when the user needs to call an LLM API for text generation, function calling, or structured data extraction.
Install this agent skill to your Project
npx add-skill https://github.com/binome-dev/humcp/tree/main/src/tools/llm
SKILL.md
LLM Tools
Tools for generating text, calling functions, and extracting structured data using LLM APIs.
Requirements
Set environment variables for the providers you want to use:
ANTHROPIC_API_KEY: For Claude toolsOPENAI_API_KEY: For OpenAI toolsGOOGLE_API_KEY: For Gemini toolsOLLAMA_HOST: For Ollama (optional, defaults tohttp://localhost:11434)
Basic Chat
result = await claude_chat(prompt="Explain quantum computing")
result = await openai_chat(prompt="Explain quantum computing")
result = await gemini_chat(prompt="Explain quantum computing")
result = await ollama_chat(prompt="Explain quantum computing")
Tool / Function Calling
Claude
result = await claude_chat(
prompt="What's the weather in San Francisco?",
tools=[{
"name": "get_weather",
"description": "Get current weather for a location",
"input_schema": {
"type": "object",
"properties": {
"location": {"type": "string"}
},
"required": ["location"]
}
}],
tool_choice={"type": "auto"}
)
# result["data"]["tool_calls"] = [{"id": "...", "name": "get_weather", "input": {"location": "San Francisco"}}]
OpenAI (Responses API)
Supports both custom function tools and built-in tools (web_search, file_search, code_interpreter).
# Custom function tool
result = await openai_chat(
prompt="What's the weather in San Francisco?",
tools=[{
"type": "function",
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string"}
},
"required": ["location"]
}
}],
tool_choice="auto"
)
# result["data"]["tool_calls"] = [{"id": "...", "name": "get_weather", "arguments": {"location": "San Francisco"}}]
# Built-in web search
result = await openai_chat(
prompt="What happened in the news today?",
tools=[{"type": "web_search"}]
)
Gemini
result = await gemini_chat(
prompt="What's the weather in San Francisco?",
tools=[{
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string"}
},
"required": ["location"]
}
}],
tool_config={"function_calling_config": {"mode": "AUTO"}}
)
# result["data"]["tool_calls"] = [{"name": "get_weather", "args": {"location": "San Francisco"}}]
Ollama
result = await ollama_chat(
prompt="What's the weather in San Francisco?",
tools=[{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string"}
},
"required": ["location"]
}
}
}]
)
# result["data"]["tool_calls"] = [{"name": "get_weather", "arguments": {"location": "San Francisco"}}]
Structured Output (JSON Schema)
Claude
result = await claude_chat(
prompt="Extract: John Smith, john@example.com, Enterprise plan",
response_format={
"type": "object",
"properties": {
"name": {"type": "string"},
"email": {"type": "string"},
"plan": {"type": "string"}
},
"required": ["name", "email", "plan"]
}
)
OpenAI
# JSON mode (valid JSON, no schema enforcement)
result = await openai_chat(
prompt="List 3 colors as JSON",
system_prompt="Respond in JSON format.",
response_format={"type": "json_object"}
)
# Structured output (schema-enforced)
result = await openai_chat(
prompt="Extract: John Smith, john@example.com, Enterprise plan",
response_format={
"type": "json_schema",
"name": "contact_info",
"strict": True,
"schema": {
"type": "object",
"properties": {
"name": {"type": "string"},
"email": {"type": "string"},
"plan": {"type": "string"}
},
"required": ["name", "email", "plan"],
"additionalProperties": False
}
}
)
Gemini
result = await gemini_chat(
prompt="Extract: John Smith, john@example.com, Enterprise plan",
response_format={
"type": "object",
"properties": {
"name": {"type": "string"},
"email": {"type": "string"},
"plan": {"type": "string"}
},
"required": ["name", "email", "plan"]
}
)
Ollama
# JSON mode
result = await ollama_chat(
prompt="List 3 colors as JSON",
response_format="json"
)
# Schema-enforced structured output
result = await ollama_chat(
prompt="Extract: John Smith, john@example.com, Enterprise plan",
response_format={
"type": "object",
"properties": {
"name": {"type": "string"},
"email": {"type": "string"},
"plan": {"type": "string"}
},
"required": ["name", "email", "plan"]
}
)
Response Format
All tools return a standardized response:
{
"success": true,
"data": {
"model": "gpt-4o",
"content": "Generated text...",
"usage": {"input_tokens": 25, "output_tokens": 150},
"tool_calls": [{"id": "...", "name": "fn", "arguments": {...}}]
}
}
Provider-specific fields:
- Claude:
stop_reason("end_turn","tool_use","max_tokens") - OpenAI:
id(response ID for chaining),status("completed","failed") - Gemini:
finish_reason("STOP","MAX_TOKENS") - Ollama:
done_reason("stop", etc.)
Parameters
| Parameter | Type | Claude | OpenAI | Gemini | Ollama |
|---|---|---|---|---|---|
| prompt | str | Yes | Yes | Yes | Yes |
| system_prompt | str | Yes | Yes | Yes | Yes |
| model | str | Yes | Yes | Yes | Yes |
| temperature | float | 0-1 | 0-2 | 0-2 | Yes |
| max_tokens | int | Yes | Yes | Yes | Yes |
| top_p | float | Yes | Yes | Yes | Yes |
| top_k | int | Yes | - | Yes | Yes |
| stop/stop_sequences | list[str] | Yes | - | Yes | Yes |
| frequency_penalty | float | - | - | Yes | Yes |
| presence_penalty | float | - | - | Yes | Yes |
| seed | int | - | - | - | Yes |
| tools | list[dict] | Yes | Yes | Yes | Yes |
| tool_choice/tool_config | dict/str | Yes | Yes | Yes | - |
| response_format | dict/str | Yes | Yes | Yes | Yes |
| store | bool | - | Yes | - | - |
| host | str | - | - | - | Yes |
| extra | dict | Yes | Yes | Yes | Yes |
The extra parameter accepts a dict of additional provider-specific kwargs passed directly to the underlying API call.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
audio-tools
Text-to-speech synthesis, audio transcription, and music search. Use when the user needs to generate speech audio, transcribe audio files, or search for music on Spotify.
weather-data
Fetches current weather conditions and forecasts using the OpenWeatherMap API. Use when the user asks about weather, temperature, or forecasts for any city.
batch-research
批量数据采集技能,负责分批并发调度 researcher agent 抓取所有数据源。
chinese-writing
专注科技周刊的中文写作与审稿技能指南,指导大模型生成与审核清晰、克制、无 AI 味的高质量周刊内容。
publish-weekly
使用 Payload REST API 将周刊发布到 CMS,正文不包含头部元数据,通过 users API Key 认证。
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
Didn't find tool you were looking for?