Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/bingbing-gui_dotnet-agent-playbook.json
T

1 line
4.1 KiB
JSON
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "bingbing-gui/dotnet-agent-playbook", "files": {"src/ai-agent/Agent-Framework/30-Agent-Providers-DeepSeek/30-Agent-Providers-DeepSeek/Program.cs": {"a31c73181bf18d800f26815b82723752a0c83cd0": {"t": 1785746188.9513361, "n": 1540, "h": "afc9578bfe4a5c93", "c": "using Anthropic;\nusing Anthropic.Core;\nusing Anthropic.Models.Beta.Sessions;\nusing Microsoft.Agents.AI;\nusing Microsoft.Extensions.AI;\nusing OpenAI;\nusing OpenAI.Chat;\nusing OpenAI.Responses;\nusing System.ClientModel;\nusing System.Text;\n\n\nConsole.InputEncoding = Encoding.UTF8;\nConsole.OutputEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);\n\n\nConsole.WriteLine(\"## 基于 OpenAI 协议接入 DeepSeek V4 Pro\");\n#pragma warning disable OPENAI001\n\nvar client = new OpenAIClient(\n new ApiKeyCredential(\"sk-\"),\n new OpenAIClientOptions\n {\n Endpoint = new Uri(\"https://api.deepseek.com\")\n });\n\nvar chatClient = client.GetChatClient(\"deepseek-v4-pro\");\n\nvar result = await chatClient.AsAIAgent().RunAsync(\"你是一位江湖说书人,擅长用幽默、接地气的方式讲笑话和故事。\");\n\nConsole.WriteLine(result);\n\nConsole.WriteLine(new string('-', 60));\n\n#region 不支持Response方式\n//AIAgent agent = client\n// .GetResponsesClient()\n// .AsAIAgent(\n// model: \"deepseek-v4-pro\", // ⭐DeepSeek模型名\n// instructions: \"你是一位江湖说书人,擅长用幽默、接地气的方式讲笑话和故事。\",\n// name: \"Joker\"\n// );\n\n// 调用\n//var result = await agent.RunAsync(\"你是一位江湖说书人,擅长用幽默、接地气的方式讲笑话和故事。\");\n#endregion\n\n\nConsole.WriteLine(\"## 基于 Anthropic 协议接入 DeepSeek V4 Pro\");\n\n#pragma warning restore OPENAI001\n\nvar client2 = new AnthropicClient(new ClientOptions\n{\n ApiKey = \"sk-\",\n BaseUrl = \"https://api.deepseek.com/anthropic\"\n});\n\nvar agent = client2.AsIChatClient(\"deepseek-v4-pro\");\n\nresult = await agent.AsAIAgent().RunAsync(\"你是一位江湖说书人,擅长用幽默、接地气的方式讲笑话和故事。\");\n\nConsole.WriteLine(result);\n"}, "9d5fbfd66a054b33d8fc33a0aebdefc3fed7972d": {"t": 1785760456.0630755, "n": 1540, "h": "afc9578bfe4a5c93", "c": "using Anthropic;\nusing Anthropic.Core;\nusing Anthropic.Models.Beta.Sessions;\nusing Microsoft.Agents.AI;\nusing Microsoft.Extensions.AI;\nusing OpenAI;\nusing OpenAI.Chat;\nusing OpenAI.Responses;\nusing System.ClientModel;\nusing System.Text;\n\n\nConsole.InputEncoding = Encoding.UTF8;\nConsole.OutputEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);\n\n\nConsole.WriteLine(\"## 基于 OpenAI 协议接入 DeepSeek V4 Pro\");\n#pragma warning disable OPENAI001\n\nvar client = new OpenAIClient(\n new ApiKeyCredential(\"sk-\"),\n new OpenAIClientOptions\n {\n Endpoint = new Uri(\"https://api.deepseek.com\")\n });\n\nvar chatClient = client.GetChatClient(\"deepseek-v4-pro\");\n\nvar result = await chatClient.AsAIAgent().RunAsync(\"你是一位江湖说书人,擅长用幽默、接地气的方式讲笑话和故事。\");\n\nConsole.WriteLine(result);\n\nConsole.WriteLine(new string('-', 60));\n\n#region 不支持Response方式\n//AIAgent agent = client\n// .GetResponsesClient()\n// .AsAIAgent(\n// model: \"deepseek-v4-pro\", // ⭐DeepSeek模型名\n// instructions: \"你是一位江湖说书人,擅长用幽默、接地气的方式讲笑话和故事。\",\n// name: \"Joker\"\n// );\n\n// 调用\n//var result = await agent.RunAsync(\"你是一位江湖说书人,擅长用幽默、接地气的方式讲笑话和故事。\");\n#endregion\n\n\nConsole.WriteLine(\"## 基于 Anthropic 协议接入 DeepSeek V4 Pro\");\n\n#pragma warning restore OPENAI001\n\nvar client2 = new AnthropicClient(new ClientOptions\n{\n ApiKey = \"sk-\",\n BaseUrl = \"https://api.deepseek.com/anthropic\"\n});\n\nvar agent = client2.AsIChatClient(\"deepseek-v4-pro\");\n\nresult = await agent.AsAIAgent().RunAsync(\"你是一位江湖说书人,擅长用幽默、接地气的方式讲笑话和故事。\");\n\nConsole.WriteLine(result);\n"}}}}