liter-llm-tool-calling
/liter-llm-tool-calling
Pomaga definiować funkcje i narzędzia dla modelu wywoływane przez liter-llm oraz żądać ustrukturyzowanych odpowiedzi JSON, ze schematami narzędzi, obsługą tool_calls i formatami odpowiedzi.
- Autor
- xberg-io ↗
- Repozytorium
- liter-llm ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 27.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 0
- Komentarze HTML
- 1
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.
Co robi i kiedy
Pomaga definiować funkcje i narzędzia dla modelu wywoływane przez liter-llm oraz żądać ustrukturyzowanych odpowiedzi JSON, ze schematami narzędzi, obsługą tool_calls i formatami odpowiedzi.
Oryginalny opis (EN)
Use when defining functions/tools for an LLM to call through liter-llm, or requesting structured JSON outputs. Covers tool schemas, tool_calls handling, and response formats.
Jak działa
- Python
- Structured outputs
- Notes
Podgląd SKILL.md
---
description: Use when defining functions/tools for an LLM to call through liter-llm, or requesting structured JSON outputs. Covers tool schemas, tool_calls handling, and response formats.
name: liter-llm-tool-calling
---
<!--
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
Content-Hash: blake3:f26049693a8fa3229f675eefc4097cfa0aeb669a5744967a7ab3614009a80310
Source-Hash: blake3:50dd9cd19af67cecc1df0bab0477ef5b3d06a96df3035cc78f8140e1b558cd7c
Schema-Version: v1
-->
# Tool Calling
Pass a `tools` array of function definitions; the model may respond with
`tool_calls` instead of (or alongside) text. Execute the named function and feed
the result back as a `tool` message.
## Python
```python
import asyncio, json, os
from liter_llm import create_client
from liter_llm._internal_bindings import ChatCompletionRequest
payload = {
"model": "openai/gpt-4o",
"messages": [{"role": "user", "content": "What is the weather in Berlin?"}],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"},
},
"required": ["location"],
},
},
}
],
"tool_choice": "auto",
}
async def main() -> None:
client = create_client(api_key=os.environ["OPENAI_API_KEY"])
request = ChatCompletionRequest.from_json(json.dumps(payload))
response = await client.chat(request)
for call in response.choices[0].message.tool_calls or []:
print(call.function.name, call.function.arguments) # arguments is a JSON string
asyncio.run(main())
```
## Structured outputs
Request strict JSON with `response_format`:
```python
request = ChatCompletionRequest.from_json(json.dumps({
"model": "openai/gpt-4o",
"messages": [{"role": "user", "content": "Extract name and age as JSON."}],
"response_format": {"type": "json_object"},
}))
response = await client.chat(request)
```
## Notes
- `function.arguments` is a JSON **string** — parse it before use.
- Append each tool result as a message with `role="tool"` and the matching
`tool_call_id`, then call `chat` again to let the model continue.
- Tool support and JSON-mode availability vary by provider; check the provider
reference if a model ignores `tools`.
Pliki w paczce (2)
- SKILL.md 2 KB
- index.md 1 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · xberg-io/liter-llm | 100 | MIT |
| xberg-io/liter-llm | 100 | MIT |
| xberg-io/liter-llm | 84 | MIT |
Identyczna treść występuje jeszcze w 6 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.
Migawka bazy z 13.11.2026 · wersja paczki b885a9cc2145 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 1 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100liter-llm-using-the-mcp-server
Wywołuje modele LLM przez serwer MCP liter-llm, z 22 narzędziami, i pomaga wybrać MCP zamiast CLI lub SDK. - 84liter-llm-using-the-mcp-server
Wywołuje API LLM przez 22 narzędzia serwera MCP liter-llm i podpowiada, kiedy MCP jest lepszy niż CLI lub SDK. - 100tool-use-schema-design
Projektuje schematy wywołań funkcji, które modele LLM używają niezawodnie, z opisami, parametrami i strukturą JSON. - 100tool-calling-principles
Projektuje interfejsy narzędzi dla agentów LLM: nazwy, opisy, ścisłe schematy, kontrakty błędów i poziomy uprawnień. - 100llm-runtime
Integruje, strumieniuje i orkiestruje API wiodących LLM ze schematami narzędzi, ustrukturyzowanymi wyjściami, prompt cachingiem i odpornym backoffem, dla runtime'ów agentów, pętli wywołań narzędzi i endpointów SSE. - 100llm
Pomaga budować funkcje AI dla użytkowników: ustrukturyzowane wyjście, schematy narzędzi, ochrona przed prompt injection i ewaluacje, w tym idempotentne wywołania narzędzi i bramki potwierdzeń.