This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE DATABASE SchoolDB; | |
| GO | |
| USE SchoolDB; | |
| GO | |
| CREATE TABLE Students ( | |
| StudentId int IDENTITY(1,1) PRIMARY KEY, | |
| FirstName NVARCHAR(50) NOT NULL, | |
| LastName NVARCHAR(50) NOT NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Betalgo.Ranul.OpenAI.ObjectModels.RequestModels; | |
| using Microsoft.AI.Foundry.Local; | |
| using Microsoft.Extensions.Logging; | |
| CancellationToken ct = new(); | |
| var config = new Configuration { | |
| AppName = "foundry_local_samples", | |
| LogLevel = Microsoft.AI.Foundry.Local.LogLevel.Information | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using ModelContextProtocol.Client; | |
| using Microsoft.Extensions.Logging; | |
| using Microsoft.Extensions.AI; | |
| using System.Text.Json; | |
| using Microsoft.Extensions.Configuration; | |
| // Load configuration from appsettings.json | |
| var config = new ConfigurationBuilder() | |
| .SetBasePath(Directory.GetCurrentDirectory()) | |
| .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [{"id":1,"name":"bulbasaur","imageUrl":"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/1.png"},{"id":2,"name":"ivysaur","imageUrl":"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/2.png"},{"id":3,"name":"venusaur","imageUrl":"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/3.png"},{"id":4,"name":"charmander","imageUrl":"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/4.png"},{"id":5,"name":"charmeleon","imageUrl":"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/5.png"},{"id":6,"name":"charizard","imageUrl":"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/6.png"},{"id":7,"name":"squirtle","imageUrl":"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/7.png"},{"id":8,"name":"wartortl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "id": 1, | |
| "name": "Atlanta Hawks", | |
| "city": "Atlanta", | |
| "abbreviation": "ATL", | |
| "logoUrl": "https://a.espncdn.com/i/teamlogos/nba/500/atl.png" | |
| }, | |
| { | |
| "id": 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "StudentId": 1, | |
| "FirstName": "Tom", | |
| "LastName": "Max", | |
| "School": "Nursing", | |
| "Gender": "Male", | |
| "DateOfBirth": "1998-06-12" | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using OpenAI; | |
| using OpenAI.Chat; | |
| using System.ClientModel; | |
| using System.Text; | |
| var model = "mistral-7b-v02-int4-cpu"; | |
| var baseUrl = "http://localhost:5272/v1/"; // root URL for local OpenAI-like server | |
| var apikey = "unused"; | |
| OpenAIClientOptions options = new OpenAIClientOptions(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Text; | |
| using Microsoft.SemanticKernel; | |
| using Microsoft.SemanticKernel.ChatCompletion; | |
| using Microsoft.SemanticKernel.Connectors.OpenAI; | |
| var model = "mistral-7b-v02-int4-cpu"; | |
| var baseUrl = "http://localhost:5272/v1/"; | |
| var apikey = "unused"; | |
| // Create a chat completion service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "GameId": 1, | |
| "Year": 1930, | |
| "Gender": "Men", | |
| "City": "Montevideo", | |
| "Country": "Uruguay", | |
| "Continent": "South America", | |
| "Winner": "Uruguay" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ZodiacMcpTool { | |
| [Function("ZodiacMcpTool")] | |
| public IActionResult Run( | |
| [McpToolTrigger(McpToolDefinitions.ZodiacTool.Name, McpToolDefinitions.ZodiacTool.Description)] | |
| ToolInvocationContext context, | |
| [McpToolProperty(McpToolDefinitions.ZodiacTool.Param.Name, McpToolDefinitions.DataTypes.Number, McpToolDefinitions.ZodiacTool.Param.Description)] | |
| int year) | |
| { | |
| return new OkObjectResult($"Hi. I am {McpToolDefinitions.ZodiacTool.Name}!. The zodiac animal for the year {year} is: {GetZodiacAnimal(year)}"); | |
| } |
NewerOlder