Skip to content

Commit 34567a9

Browse files
committed
初始提交
0 parents  commit 34567a9

File tree

484 files changed

+192761
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

484 files changed

+192761
-0
lines changed

.idea/.idea.Round.NET.BlazorWeb.ChatWeb/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.Round.NET.BlazorWeb.ChatWeb/.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.Round.NET.BlazorWeb.ChatWeb/.idea/git_toolbox_blame.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.Round.NET.BlazorWeb.ChatWeb/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.Round.NET.BlazorWeb.ChatWeb/.idea/riderPublish.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Ollama;
2+
3+
string modelName = "deepseek-r1:7b";
4+
using var ollama = new OllamaApiClient(baseUri: new Uri("http://127.0.0.1:11434/api"));
5+
6+
Console.WriteLine("开始对话!!!");
7+
string userInput = "";
8+
do
9+
{
10+
Console.WriteLine("User:");
11+
userInput = Console.ReadLine()!;
12+
var enumerable = ollama.Completions.GenerateCompletionAsync(modelName, userInput);
13+
Console.WriteLine("Agent:");
14+
await foreach (var response in enumerable)
15+
{
16+
Console.Write($"{response.Response}");
17+
}
18+
Console.WriteLine();
19+
20+
} while (!string.Equals(userInput, "exit", StringComparison.OrdinalIgnoreCase));
21+
Console.WriteLine("对话结束!!!");
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Markdig" Version="0.40.0" />
12+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
13+
<PackageReference Include="Ollama" Version="1.9.0" />
14+
</ItemGroup>
15+
16+
</Project>
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"runtimeTarget": {
3+
"name": ".NETCoreApp,Version=v9.0",
4+
"signature": ""
5+
},
6+
"compilationOptions": {},
7+
"targets": {
8+
".NETCoreApp,Version=v9.0": {
9+
"Round.NET.BlazorWeb.ChatWeb.ConsoleTest/1.0.0": {
10+
"dependencies": {
11+
"Ollama": "1.9.0"
12+
},
13+
"runtime": {
14+
"Round.NET.BlazorWeb.ChatWeb.ConsoleTest.dll": {}
15+
}
16+
},
17+
"Ollama/1.9.0": {
18+
"dependencies": {
19+
"System.Text.Json": "8.0.4"
20+
},
21+
"runtime": {
22+
"lib/net8.0/Ollama.dll": {
23+
"assemblyVersion": "1.0.0.0",
24+
"fileVersion": "1.9.0.0"
25+
}
26+
}
27+
},
28+
"System.Text.Encodings.Web/8.0.0": {},
29+
"System.Text.Json/8.0.4": {
30+
"dependencies": {
31+
"System.Text.Encodings.Web": "8.0.0"
32+
}
33+
}
34+
}
35+
},
36+
"libraries": {
37+
"Round.NET.BlazorWeb.ChatWeb.ConsoleTest/1.0.0": {
38+
"type": "project",
39+
"serviceable": false,
40+
"sha512": ""
41+
},
42+
"Ollama/1.9.0": {
43+
"type": "package",
44+
"serviceable": true,
45+
"sha512": "sha512-RRPcOzMoY1atTMNH6gjYTFpETXxC3pF4ZkS9jZQBWvl1hcU+31Unvup89thDaN2m7TsXz/TbLTtW1jdPziA4RQ==",
46+
"path": "ollama/1.9.0",
47+
"hashPath": "ollama.1.9.0.nupkg.sha512"
48+
},
49+
"System.Text.Encodings.Web/8.0.0": {
50+
"type": "package",
51+
"serviceable": true,
52+
"sha512": "sha512-yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ==",
53+
"path": "system.text.encodings.web/8.0.0",
54+
"hashPath": "system.text.encodings.web.8.0.0.nupkg.sha512"
55+
},
56+
"System.Text.Json/8.0.4": {
57+
"type": "package",
58+
"serviceable": true,
59+
"sha512": "sha512-bAkhgDJ88XTsqczoxEMliSrpijKZHhbJQldhAmObj/RbrN3sU5dcokuXmWJWsdQAhiMJ9bTayWsL1C9fbbCRhw==",
60+
"path": "system.text.json/8.0.4",
61+
"hashPath": "system.text.json.8.0.4.nupkg.sha512"
62+
}
63+
}
64+
}

0 commit comments

Comments
 (0)