feat: add how it works section

This commit is contained in:
drbh 2024-04-19 14:42:34 +00:00
parent 2d0a7173d4
commit 26ba2d50a3

View File

@ -10,6 +10,10 @@ Before we jump into the deep end, ensure your system is using TGI version `1.4.3
If you're not up to date, grab the latest version and let's get started! If you're not up to date, grab the latest version and let's get started!
## How it works
TGI's leverages the [outlines](https://github.com/outlines-dev/outlines) library to efficiently parse and compile the grammatical structures and tools specified by users. This integration transforms the defined grammars into an intermediate representation that acts as a framework to guide and constrain content generation, ensuring that outputs adhere to the specified grammatical rules.
## Table of Contents 📚 ## Table of Contents 📚
### Grammar and Constraints ### Grammar and Constraints
@ -268,58 +272,58 @@ curl localhost:3000/v1/chat/completions \
<details> <details>
<summary>Tools used in example below</summary> <summary>Tools used in example below</summary>
```python ```python
tools = [ tools = [
{ {
"type": "function", "type": "function",
"function": { "function": {
"name": "get_current_weather", "name": "get_current_weather",
"description": "Get the current weather", "description": "Get the current weather",
"parameters": { "parameters": {
"type": "object", "type": "object",
"properties": { "properties": {
"location": { "location": {
"type": "string", "type": "string",
"description": "The city and state, e.g. San Francisco, CA", "description": "The city and state, e.g. San Francisco, CA",
}, },
"format": { "format": {
"type": "string", "type": "string",
"enum": ["celsius", "fahrenheit"], "enum": ["celsius", "fahrenheit"],
"description": "The temperature unit to use. Infer this from the users location.", "description": "The temperature unit to use. Infer this from the users location.",
}, },
}, },
"required": ["location", "format"], "required": ["location", "format"],
}, },
}, },
}, },
{ {
"type": "function", "type": "function",
"function": { "function": {
"name": "get_n_day_weather_forecast", "name": "get_n_day_weather_forecast",
"description": "Get an N-day weather forecast", "description": "Get an N-day weather forecast",
"parameters": { "parameters": {
"type": "object", "type": "object",
"properties": { "properties": {
"location": { "location": {
"type": "string", "type": "string",
"description": "The city and state, e.g. San Francisco, CA", "description": "The city and state, e.g. San Francisco, CA",
}, },
"format": { "format": {
"type": "string", "type": "string",
"enum": ["celsius", "fahrenheit"], "enum": ["celsius", "fahrenheit"],
"description": "The temperature unit to use. Infer this from the users location.", "description": "The temperature unit to use. Infer this from the users location.",
}, },
"num_days": { "num_days": {
"type": "integer", "type": "integer",
"description": "The number of days to forecast", "description": "The number of days to forecast",
}, },
}, },
"required": ["location", "format", "num_days"], "required": ["location", "format", "num_days"],
}, },
}, },
} }
] ]
``` ```
</details> </details>