|
Download ai/ai-0007.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 1.36 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/ai/ai-0007.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm/ai/ai-0007.jsonl
-
curl -L -o ai-0007.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/ai/ai-0007.jsonl
1.36 kB
| {"type": "session", "harness": "opencode", "id": "ai-0007", "name": "OpenAI Tool Calling Pattern"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert software engineer."}} | |
| {"type": "message", "message": {"role": "user", "content": "How does OpenAI's tool/function calling work?"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "Tool call flow:\n\n1. User defines tools: [{\"type\": \"function\", \"function\": {name, description, parameters (JSON Schema), strict}}]\n2. API returns message.tool_calls: [{id, function: {name, arguments (JSON string)}}]\n3. App executes local function using arguments\n4. App appends: assistant message (with tool_calls) + tool message (role: \"tool\", tool_call_id: id, content: result)\n5. Sends new request with updated messages\n\nAutomatic parsing with parse():\n- Validates tools are strict and function type\n- Returns ParsedChatCompletion with ParsedFunctionToolCall\n- function.parsed_arguments is a Pydantic model instance\n\nStreaming tool calls:\n- tool_calls.delta events with incremental arguments strings\n- tool_calls.done events provide complete parsed tool call\n- State accumulation concatenates JSON fragments until complete\n\nResponses API supports: function, web_search_preview, code_interpreter, computer_use_preview, image_generation, MCP tools."}} | |