Skip to content

Commit

Permalink
docs: Simplified README.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Oct 16, 2024
1 parent da43f06 commit 19abf98
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ await api.Run.CreateRunAsync(
name: "Chat Pipeline",
runType: CreateRunRequestRunType.Chain,
id: parentRunId,
inputs: new CreateRunRequestInputs
inputs: new Dictionary<string, object>
{
AdditionalProperties = new Dictionary<string, object>
{
["question"] = question,
},
["question"] = question,
});

// Create child run
Expand All @@ -55,12 +52,9 @@ await api.Run.CreateRunAsync(
runType: CreateRunRequestRunType.Llm,
id: childRunId,
parentRunId: parentRunId,
inputs: new CreateRunRequestInputs
inputs: new Dictionary<string, object>
{
AdditionalProperties = new Dictionary<string, object>
{
["messages"] = messages,
},
["messages"] = messages,
});

// Generate a completion
Expand All @@ -71,22 +65,16 @@ var chatCompletion = await openAiApi.Chat.CreateChatCompletionAsync(
// End runs
await api.Run.UpdateRunAsync(
runId: childRunId,
outputs: new UpdateRunRequestOutputs
outputs: new Dictionary<string, object>
{
AdditionalProperties = new Dictionary<string, object>
{
["chatCompletion"] = chatCompletion,
},
["chatCompletion"] = chatCompletion,
},
endTime: DateTime.UtcNow.ToString("O"));
await api.Run.UpdateRunAsync(
runId: parentRunId,
outputs: new UpdateRunRequestOutputs
outputs: new Dictionary<string, object>
{
AdditionalProperties = new Dictionary<string, object>
{
["answer"] = chatCompletion.Choices[0].Message.Content ?? string.Empty,
},
["answer"] = chatCompletion.Choices[0].Message.Content ?? string.Empty,
},
endTime: DateTime.UtcNow.ToString("O"));
```
Expand Down

0 comments on commit 19abf98

Please sign in to comment.