Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Sep 19, 2024
1 parent 565f836 commit fc23933
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1365,23 +1365,19 @@ These are the objects you'll deserialize to, so be sure to use standard Json obj
```csharp
public class MathResponse
{
[JsonInclude]
[JsonPropertyName("steps")]
[JsonProperty("steps")]
public IReadOnlyList<MathStep> Steps { get; private set; }

[JsonInclude]
[JsonPropertyName("final_answer")]
[JsonProperty("final_answer")]
public string FinalAnswer { get; private set; }
}

public class MathStep
{
[JsonInclude]
[JsonPropertyName("explanation")]
[JsonProperty("explanation")]
public string Explanation { get; private set; }

[JsonInclude]
[JsonPropertyName("output")]
[JsonProperty("output")]
public string Output { get; private set; }
}
```
Expand All @@ -1396,7 +1392,7 @@ var messages = new List<Message>
new(Role.User, "how can I solve 8x + 7 = -23")
};

var chatRequest = new ChatRequest<MathResponse>(messages, model: new("gpt-4o-2024-08-06"));
var chatRequest = new ChatRequest(messages, model: "gpt-4o-2024-08-06");
var (mathResponse, chatResponse) = await api.ChatEndpoint.GetCompletionAsync<MathResponse>(chatRequest);

for (var i = 0; i < mathResponse.Steps.Count; i++)
Expand Down

0 comments on commit fc23933

Please sign in to comment.