Update README.md
Browse files
README.md
CHANGED
|
@@ -116,19 +116,19 @@ print(response)
|
|
| 116 |
# 'I\'d be happy to check the temperature for you. Could you please let me know which location you\'re interested in? Please provide the city and country (e.g., "New York, USA").'
|
| 117 |
|
| 118 |
messages.append({"role": "assistant", "content": 'I\'d be happy to check the temperature for you. Could you please let me know which location you\'re interested in? Please provide the city and country (e.g., "New York, USA").'})
|
| 119 |
-
messages.append({"role": "user", "content": "I live in
|
| 120 |
|
| 121 |
response = generate_output(messages)
|
| 122 |
print(response)
|
| 123 |
-
# '
|
| 124 |
|
| 125 |
-
tool_calls = [{"type": "function", "function": {"name": "get_current_temperature", "arguments": {"location": "
|
| 126 |
messages.append({"role": "assistant", "tool_calls": tool_calls})
|
| 127 |
|
| 128 |
messages.append({"role": "tool", "name": "get_current_temperature", "content": "22.0"})
|
| 129 |
response = generate_output(messages)
|
| 130 |
print(response)
|
| 131 |
-
# The current temperature in
|
| 132 |
```
|
| 133 |
|
| 134 |
### With SGLang
|
|
|
|
| 116 |
# 'I\'d be happy to check the temperature for you. Could you please let me know which location you\'re interested in? Please provide the city and country (e.g., "New York, USA").'
|
| 117 |
|
| 118 |
messages.append({"role": "assistant", "content": 'I\'d be happy to check the temperature for you. Could you please let me know which location you\'re interested in? Please provide the city and country (e.g., "New York, USA").'})
|
| 119 |
+
messages.append({"role": "user", "content": "I live in San Francisco."})
|
| 120 |
|
| 121 |
response = generate_output(messages)
|
| 122 |
print(response)
|
| 123 |
+
# '<|tool▁calls▁begin|><|tool▁call▁begin|>function<|tool▁sep|>get_current_temperature<|tool▁sep|>{"location": "San Francisco, USA"}<|tool▁call▁end|><|tool▁calls▁end|>'
|
| 124 |
|
| 125 |
+
tool_calls = [{"type": "function", "function": {"name": "get_current_temperature", "arguments": {"location": "San Francisco, USA"}}}]
|
| 126 |
messages.append({"role": "assistant", "tool_calls": tool_calls})
|
| 127 |
|
| 128 |
messages.append({"role": "tool", "name": "get_current_temperature", "content": "22.0"})
|
| 129 |
response = generate_output(messages)
|
| 130 |
print(response)
|
| 131 |
+
# The current temperature in San Francisco, USA is 22°C.
|
| 132 |
```
|
| 133 |
|
| 134 |
### With SGLang
|