You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+57-7Lines changed: 57 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,14 @@
1
1
# GrokSdk 🚀
2
2
3
+
If you find this tool helpful or are able to use it in your projects, please drop me a note on [X](https://x.com/twhidden) to let me know—it encourages me to keep it going!
[](https://dotnet.microsoft.com/en-us/platform/dotnet-standard)
8
10
9
-
An unofficial .NET library for interacting with Grok's API, with `GrokThread` as its centerpiece. This library streamlines conversation management, tool integration (e.g., image generation), and real-time streaming in .NET applications.
11
+
An unofficial .NET library for interacting with Grok's API, with `GrokThread` as its centerpiece. This library streamlines conversation management, tool integration (e.g., image generation and reasoning), and real-time streaming in .NET applications.
10
12
11
13
## Installation
12
14
@@ -46,12 +48,18 @@ internal class Program
46
48
// Show welcome message
47
49
Console.WriteLine("Welcome to the Grok Chat Console. Type your questions below. Type 'quit' to exit.");
// Preload context with neutral discussion (non-API processed)
57
65
thread.AddUserMessage("Alex Said: I tried a new coffee shop today.");
@@ -98,6 +106,10 @@ internal class Program
98
106
Console.ForegroundColor=ConsoleColor.Red;
99
107
Console.WriteLine("Error Processing...");
100
108
break;
109
+
caseStreamState.CallingTool:
110
+
Console.ForegroundColor=ConsoleColor.Magenta;
111
+
Console.WriteLine("Calling Tool...");
112
+
break;
101
113
}
102
114
Console.ResetColor();
103
115
}
@@ -197,6 +209,44 @@ internal static class ImageGeneratorHelper
197
209
-**Compression**: Shrinks history with `CompressHistoryAsync` to optimize tokens.
198
210
-**State Tracking**: Monitors states (`Thinking`, `Streaming`, etc.) for feedback.
199
211
212
+
## New Built-in Tools
213
+
214
+
### Image Generation Tool
215
+
The `GrokToolImageGeneration` tool allows Grok to generate images based on a text prompt. Users can specify the number of images and the response format (`url` or `base64`).
0 commit comments