Skip to content

Commit

Permalink
[ Edit ] applied docs changes for edits, removed unecessary section i…
Browse files Browse the repository at this point in the history
…nt chat tools section
  • Loading branch information
anasfik committed Nov 13, 2023
1 parent e56666b commit 3a51612
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,18 +425,7 @@ final message = chat.choices.first.message;
}
```

The `tools` parameter can be set to a specific function name to force the model to use that function:
```dart
functionCall: FunctionCall.forFunction('get_current_weather')
```

You can access the results in the `paramters` field of the `function_call` field.

```dart
FunctionCallResponse? response = chatCompletion.choices.first.message.functionCall;
String? functionName = response?.name;
Map<String, dynamic>? functionParameters = response?.parameters;
```e
Learn more from [here](https://platform.openai.com/docs/api-reference/chat/create).

## Edits

Expand All @@ -446,12 +435,17 @@ Creates an edited version of the given prompt based on the used model.

```dart
OpenAIEditModel edit = await OpenAI.instance.edit.create(
model: "text-davinci-edit-001";
instruction: "remote all '!'from input text",
input: "Hello!!, I! need to be ! somethi!ng"
n: 1,
temperature: 0.8,
model: "text-davinci-edit-001";
instruction: "remote all '!'from input text",
input: "Hello!!, I! need to be ! somethi!ng"
n: 1,
temperature: 0.8,
);
// Prints the choices.
for (int index = 0; index < edit.choices.length; index++) {
print(edit.choices[index].text);
}
```

[Learn More From Here.](https://platform.openai.com/docs/api-reference/edits)
Expand Down

0 comments on commit 3a51612

Please sign in to comment.