Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ scratch.txt

# Codex CLI generated state
**/.codex/

src/samples/01.DiscordAgent/Properties/
data/discord-chat.ndjson

46 changes: 46 additions & 0 deletions data/discord-chat.ndjson
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file shouldn't be checked in, make sure these data files get added to the .gitignore

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":2,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":2,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":2,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":2,"entry":{"$type":"ChatEfferentDraft","text":"Yes\u2014loud and clear! I can see your message and everything\u2019s working. What would you like to do next?","sender":"BOT"}}
{"schemaVersion":"1","position":3,"entry":{"$type":"ChatChunk","text":"Yes\u2014loud and clear! I can see your message and everything\u2019s working. What would you like to do next?","sender":"BOT"}}
{"schemaVersion":"1","position":4,"entry":{"$type":"ChatStreamCompleted","sender":"BOT"}}
{"schemaVersion":"1","position":5,"entry":{"$type":"ChatEfferent","text":"Yes\u2014loud and clear! I can see your message and everything\u2019s working. What would you like to do next?","sender":"BOT"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":2,"entry":{"$type":"ChatEfferentDraft","text":"Yes\u2014it\u0027s working. I can see your message. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":3,"entry":{"$type":"ChatChunk","text":"Yes\u2014it\u0027s working. I can see your message. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":4,"entry":{"$type":"ChatStreamCompleted","sender":"BOT"}}
{"schemaVersion":"1","position":5,"entry":{"$type":"ChatEfferent","text":"Yes\u2014it\u0027s working. I can see your message. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":6,"entry":{"$type":"ChatAck","position":2,"sender":"BOT"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":2,"entry":{"$type":"ChatEfferentDraft","text":"Yes\u2014loud and clear, hunts135. I can see your message and reply here. What would you like to do next?","sender":"BOT"}}
{"schemaVersion":"1","position":3,"entry":{"$type":"ChatChunk","text":"Yes\u2014loud and clear, hunts135. I can see your message and reply here. What would you like to do next?","sender":"BOT"}}
{"schemaVersion":"1","position":4,"entry":{"$type":"ChatStreamCompleted","sender":"BOT"}}
{"schemaVersion":"1","position":5,"entry":{"$type":"ChatEfferent","text":"Yes\u2014loud and clear, hunts135. I can see your message and reply here. What would you like to do next?","sender":"BOT"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":2,"entry":{"$type":"ChatEfferentDraft","text":"Yes\u2014your message came through. I can see you, hunts135. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":3,"entry":{"$type":"ChatChunk","text":"Yes\u2014your message came through. I can see you, hunts135. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":4,"entry":{"$type":"ChatStreamCompleted","sender":"BOT"}}
{"schemaVersion":"1","position":5,"entry":{"$type":"ChatEfferent","text":"Yes\u2014your message came through. I can see you, hunts135. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":6,"entry":{"$type":"ChatAck","position":2,"sender":"BOT"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":2,"entry":{"$type":"ChatEfferentDraft","text":"Yes\u2014got your message, hunts135. I\u2019m here and responsive. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":3,"entry":{"$type":"ChatChunk","text":"Yes\u2014got your message, hunts135. I\u2019m here and responsive. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":4,"entry":{"$type":"ChatStreamCompleted","sender":"BOT"}}
{"schemaVersion":"1","position":5,"entry":{"$type":"ChatEfferent","text":"Yes\u2014got your message, hunts135. I\u2019m here and responsive. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":6,"entry":{"$type":"ChatAck","position":2,"sender":"BOT"}}
{"schemaVersion":"1","position":1,"entry":{"$type":"ChatAfferent","text":"Is this working?","sender":"hunts135"}}
{"schemaVersion":"1","position":2,"entry":{"$type":"ChatEfferentDraft","text":"Yes\u2014I can see your message, hunts135. Looks like everything\u2019s working. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":3,"entry":{"$type":"ChatChunk","text":"Yes\u2014I can see your message, hunts135. Looks like everything\u2019s working. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":4,"entry":{"$type":"ChatStreamCompleted","sender":"BOT"}}
{"schemaVersion":"1","position":5,"entry":{"$type":"ChatEfferent","text":"Yes\u2014I can see your message, hunts135. Looks like everything\u2019s working. How can I help?","sender":"BOT"}}
{"schemaVersion":"1","position":6,"entry":{"$type":"ChatAck","position":2,"sender":"BOT"}}
8 changes: 4 additions & 4 deletions src/Coven.Agents.OpenAI/OpenAIClientConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ public sealed record OpenAIClientConfig
public int? MaxOutputTokens { get; init; }

/// <summary>
/// Max number of transcript items to include; defaults to unlimited.
/// Configures reasoning options for models that support it.
/// </summary>
public int HistoryClip { get; init; } = int.MaxValue;
public ReasoningConfig? Reasoning { get; init; }

/// <summary>
/// Configures reasoning options for models that support it.
/// Max number of transcript items to include; defaults to unlimited.
/// </summary>
public ReasoningConfig Reasoning { get; init; } = new ReasoningConfig();
public int HistoryClip { get; init; } = int.MaxValue;
}
16 changes: 11 additions & 5 deletions src/Coven.Agents.OpenAI/OpenAIResponseOptionsTransmuter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,29 @@ public Task<ResponseCreationOptions> Transmute(OpenAIClientConfig Input, Cancell

if (Input.Reasoning is not null)
{
options.ReasoningOptions = new ResponseReasoningOptions()
ResponseReasoningOptions reasoning = new()
{
ReasoningEffortLevel = Input.Reasoning.Effort switch
{
ReasoningEffort.Low => ResponseReasoningEffortLevel.Low,
ReasoningEffort.Medium => ResponseReasoningEffortLevel.Medium,
ReasoningEffort.High => ResponseReasoningEffortLevel.High,
_ => null
},
ReasoningSummaryVerbosity = Input.Reasoning.SummaryVerbosity switch
}
};

if (Input.Reasoning.IncludeSummary)
{
reasoning.ReasoningSummaryVerbosity = Input.Reasoning.SummaryVerbosity switch
{
ReasoningSummaryVerbosity.Auto => ResponseReasoningSummaryVerbosity.Auto,
ReasoningSummaryVerbosity.Detailed => ResponseReasoningSummaryVerbosity.Detailed,
ReasoningSummaryVerbosity.Concise => ResponseReasoningSummaryVerbosity.Concise,
_ => null
}
};
};
}

options.ReasoningOptions = reasoning;
}

return Task.FromResult(options);
Expand Down
5 changes: 5 additions & 0 deletions src/Coven.Agents.OpenAI/ReasoningConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ public sealed class ReasoningConfig
/// Controls verbosity of returned reasoning summaries.
/// </summary>
public ReasoningSummaryVerbosity SummaryVerbosity { get; init; } = ReasoningSummaryVerbosity.Auto;

/// <summary>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we make the Reasoning nullable, we can get rid of this extra flag.

/// Whether to request reasoning summaries. Defaults to false.
/// </summary>
public bool IncludeSummary { get; init; }
}
4 changes: 0 additions & 4 deletions src/samples/01.DiscordAgent/DiscordAgent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
<PackageReference Include="Coven.Scriveners.FileScrivener" />
</ItemGroup>

<ItemGroup>
<Folder Include="data\" />
</ItemGroup>

</Project>
8 changes: 7 additions & 1 deletion src/samples/01.DiscordAgent/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@
OpenAIClientConfig openAiConfig = new()
{
ApiKey = string.IsNullOrWhiteSpace(envOpenAiApiKey) ? defaultOpenAiApiKey : envOpenAiApiKey,
Model = string.IsNullOrWhiteSpace(envOpenAiModel) ? defaultOpenAiModel : envOpenAiModel
Model = string.IsNullOrWhiteSpace(envOpenAiModel) ? defaultOpenAiModel : envOpenAiModel,
Reasoning = new ReasoningConfig
{
Effort = ReasoningEffort.High, // or Medium/Low
IncludeSummary = true, // optional; default false
SummaryVerbosity = ReasoningSummaryVerbosity.Detailed
}
};

// Register DI
Expand Down