Skip to content

Commit 6435ba5

Browse files
authored
Merge pull request alexrudall#285 from alexrudall/readme-functions
Tweak README
2 parents 1dc9dfd + 9b21392 commit 6435ba5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ OpenAI.configure do |config|
9191
end
9292
```
9393

94-
### Azure
94+
#### Azure
9595

9696
To use the [Azure OpenAI Service](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/) API, you can configure the gem like this:
9797

@@ -164,9 +164,9 @@ client.chat(
164164
# => "Anna is a young woman in her mid-twenties, with wavy chestnut hair that falls to her shoulders..."
165165
```
166166

167-
### Function Calling
167+
### Functions
168168

169-
Developers can describe functions and have the model intelligently choose to output a JSON object containing arguments to call those functions.
169+
You can describe and pass in functions and the model will intelligently choose to output a JSON object containing arguments to call those them. For example, if you want the model to use your method `get_current_weather` to get the current weather in a given location:
170170

171171
```ruby
172172
def get_current_weather(location:, unit: "fahrenheit")
@@ -221,6 +221,7 @@ if message["role"] == "assistant" && message["function_call"]
221221
get_current_weather(**args)
222222
end
223223
end
224+
# => "The weather is nice 🌞"
224225
```
225226

226227
### Completions

0 commit comments

Comments
 (0)