From 93e07859418382c87f1a1013986b6ecfb85343d3 Mon Sep 17 00:00:00 2001 From: ahmed Date: Thu, 19 Mar 2026 19:33:06 +0300 Subject: [PATCH] Annotations --- Esiur.sln | 7 ++++++ Tests/Annotations/Agent.cs | 25 +++++++++++++++++++ .../Esiur.Tests.Annotations.csproj | 18 +++++++++++++ Tests/Annotations/Program.cs | 19 ++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 Tests/Annotations/Agent.cs create mode 100644 Tests/Annotations/Esiur.Tests.Annotations.csproj create mode 100644 Tests/Annotations/Program.cs diff --git a/Esiur.sln b/Esiur.sln index 552a6f3..2ec50ea 100644 --- a/Esiur.sln +++ b/Esiur.sln @@ -24,6 +24,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{2769C4C3 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Esiur.Tests.Serialization", "Tests\Serialization\Esiur.Tests.Serialization.csproj", "{58A49FFF-7A2C-2EE8-B184-9E89A168C403}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Esiur.Tests.Annotations", "Tests\Annotations\Esiur.Tests.Annotations.csproj", "{17F9CC7C-425D-1EA5-255A-C877C1FCB536}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -70,6 +72,10 @@ Global {58A49FFF-7A2C-2EE8-B184-9E89A168C403}.Debug|Any CPU.Build.0 = Debug|Any CPU {58A49FFF-7A2C-2EE8-B184-9E89A168C403}.Release|Any CPU.ActiveCfg = Release|Any CPU {58A49FFF-7A2C-2EE8-B184-9E89A168C403}.Release|Any CPU.Build.0 = Release|Any CPU + {17F9CC7C-425D-1EA5-255A-C877C1FCB536}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17F9CC7C-425D-1EA5-255A-C877C1FCB536}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17F9CC7C-425D-1EA5-255A-C877C1FCB536}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17F9CC7C-425D-1EA5-255A-C877C1FCB536}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -77,6 +83,7 @@ Global GlobalSection(NestedProjects) = preSolution {331F82B6-6B90-4533-9718-F7C8090D8F19} = {2769C4C3-2595-413B-B7FE-5903826770C1} {58A49FFF-7A2C-2EE8-B184-9E89A168C403} = {2769C4C3-2595-413B-B7FE-5903826770C1} + {17F9CC7C-425D-1EA5-255A-C877C1FCB536} = {2769C4C3-2595-413B-B7FE-5903826770C1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C584421D-5EC0-4821-B7D8-2633D8D405F2} diff --git a/Tests/Annotations/Agent.cs b/Tests/Annotations/Agent.cs new file mode 100644 index 0000000..f2224ea --- /dev/null +++ b/Tests/Annotations/Agent.cs @@ -0,0 +1,25 @@ +using Esiur.Core; +using Esiur.Data; +using Esiur.Misc; +using Esiur.Protocol; +using Esiur.Resource; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Text.Json; +using System.Text.Json.Nodes; +using System.Threading.Tasks; +using static System.Net.Mime.MediaTypeNames; + +namespace Esiur.Tests.Annotations; + + +[Resource] +public partial class Agent; + diff --git a/Tests/Annotations/Esiur.Tests.Annotations.csproj b/Tests/Annotations/Esiur.Tests.Annotations.csproj new file mode 100644 index 0000000..7532a63 --- /dev/null +++ b/Tests/Annotations/Esiur.Tests.Annotations.csproj @@ -0,0 +1,18 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + + + + diff --git a/Tests/Annotations/Program.cs b/Tests/Annotations/Program.cs new file mode 100644 index 0000000..82ba844 --- /dev/null +++ b/Tests/Annotations/Program.cs @@ -0,0 +1,19 @@ +// The endpoint for LM Studio's local server +using OpenAI; +using OpenAI.Chat; + +using System.Data; + +var endpoint = "http://localhost:1234/v1"; +var client = new OpenAIClient(new OpenAIClientOptions() +{ + Endpoint = new Uri("http://localhost:1234/v1") +}); + +var chat = client.GetChatClient("local-model"); + +var response = await chat.CompleteAsync( + "Explain what this function does" +); + +Console.WriteLine(response.Value.Content[0].Text); \ No newline at end of file