From dd4c99239fc05e4748541e428aa539de4ab63f28 Mon Sep 17 00:00:00 2001 From: suncloudsmoon Date: Sat, 5 Oct 2024 01:39:28 -0700 Subject: [PATCH] Bump version --- CommonUtils.cs | 3 + Forge.cs | 55 +-- ModelProperties.cs | 192 +++----- OfficeAddInSetup/OfficeAddInSetup.vdproj | 556 +++++++++++------------ Ollama.cs | 58 +++ Properties/AssemblyInfo.cs | 4 +- RAGControl.cs | 2 +- README.md | 4 +- TextCraft.csproj | 28 +- ThisAddIn.cs | 44 +- WordMarkdown.cs | 4 +- app.config | 10 +- packages.config | 8 +- 13 files changed, 471 insertions(+), 497 deletions(-) create mode 100644 Ollama.cs diff --git a/CommonUtils.cs b/CommonUtils.cs index 2002dcd..01279f0 100644 --- a/CommonUtils.cs +++ b/CommonUtils.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Net.Http; using System.Windows.Forms; using Microsoft.Office.Interop.Word; using Word = Microsoft.Office.Interop.Word; @@ -8,6 +9,8 @@ namespace TextForge { internal class CommonUtils { + public static readonly HttpClient client = new HttpClient(); + public static void DisplayError(Exception ex) { MessageBox.Show(ex.Message, ex.GetType().Name, MessageBoxButtons.OK, MessageBoxIcon.Error); diff --git a/Forge.cs b/Forge.cs index d055f87..b06aa6c 100644 --- a/Forge.cs +++ b/Forge.cs @@ -25,6 +25,8 @@ public partial class Forge private CustomTaskPane _generateTaskPane; private CustomTaskPane _ragControlTaskPane; + + private static readonly object door = new object(); private void Forge_Load(object sender, RibbonUIEventArgs e) { @@ -33,11 +35,11 @@ private void Forge_Load(object sender, RibbonUIEventArgs e) if (!ThisAddIn.IsAddinInitialized) ThisAddIn.InitializeAddin(); - List models = new List(ThisAddIn.ModelList); + List modelList = new List(ModelProperties.GetModelList(ThisAddIn.ModelList)); // Remove embedding models from the list - RemoveEmbeddingModels(ref models); - AddEmbeddingModelsToDropDownList(models); + modelList = RemoveEmbeddingModels(modelList).ToList(); + AddEmbeddingModelsToDropDownList(modelList); _box = new AboutBox(); _optionsBox = this.OptionsGroup; @@ -50,33 +52,29 @@ private void Forge_Load(object sender, RibbonUIEventArgs e) } } - private void RemoveEmbeddingModels(ref List modelList) + private IEnumerable RemoveEmbeddingModels(IEnumerable modelList) { - var copyList = new List(modelList); - foreach (var model in copyList) - { - foreach (var item in ModelProperties.UniqueEmbedModels) - if (model.Contains(item)) - modelList.Remove(model); - if (model.Contains("embed")) - modelList.Remove(model); - } + return modelList + .Where(model => !ModelProperties.UniqueEmbedModels.Any(item => model.Contains(item)) && !model.Contains("embed")) + .ToList(); } - private void AddEmbeddingModelsToDropDownList(List models) + private void AddEmbeddingModelsToDropDownList(IEnumerable models) { var ribbonFactory = Globals.Factory.GetRibbonFactory(); - foreach (string model in models) + var sortedModels = models.OrderBy(m => m).ToList(); + foreach (string model in sortedModels) { - var newItem = ribbonFactory.CreateRibbonDropDownItem(); - newItem.Label = model; - - ModelListDropDown.Items.Add(newItem); - - if (model == ThisAddIn.Model) { - ModelListDropDown.SelectedItem = newItem; - UpdateCheckbox(); + var newItem = ribbonFactory.CreateRibbonDropDownItem(); + newItem.Label = model; + ModelListDropDown.Items.Add(newItem); + + if (model == ThisAddIn.Model) + { + ModelListDropDown.SelectedItem = newItem; + UpdateCheckbox(); + } } } } @@ -92,13 +90,16 @@ private void GenerateButton_Click(object sender, RibbonControlEventArgs e) } } - private void ModelListDropDown_SelectionChanged(object sender, RibbonControlEventArgs e) + private async void ModelListDropDown_SelectionChanged(object sender, RibbonControlEventArgs e) { try { - ThisAddIn.Model = GetSelectedItemLabel(); - ThisAddIn.ContextLength = ModelProperties.GetContextLength(ThisAddIn.Model); - UpdateCheckbox(); + await Task.Run(() => + { + ThisAddIn.Model = GetSelectedItemLabel(); + ThisAddIn.ContextLength = ModelProperties.GetContextLength(ThisAddIn.Model, ThisAddIn.ModelList); + UpdateCheckbox(); + }); } catch (Exception ex) { diff --git a/ModelProperties.cs b/ModelProperties.cs index 0c19070..dcd09d7 100644 --- a/ModelProperties.cs +++ b/ModelProperties.cs @@ -1,7 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Nodes; +using System.Text.Json; using OpenAI.Models; +using System.Diagnostics; namespace TextForge { @@ -27,127 +30,11 @@ internal class ModelProperties { "gpt-3.5-turbo-instruct", 4096 }, }; - private static readonly Dictionary ollamaModelsContextLength = new Dictionary() - { - { "llama3.1", 131072 }, - { "gemma2", 8192 }, - { "mistral-nemo", 1024000 }, - { "mistral-large", 32768 }, - { "qwen2", 32768 }, - { "deepseek-coder-v2", 163840 }, - { "phi3", 4096 }, // the lowest config of phi3 (https://ollama.com/library/phi3:medium-4k/blobs/0d98d611d31b) - { "mistral", 32768 }, - { "mixtral", 32768 }, - { "codegemma", 8192 }, - { "command-r", 131072 }, - { "command-r-plus", 131072 }, - { "llava", 4096 }, // https://ollama.com/library/llava:13b-v1.6-vicuna-q4_0/blobs/87d5b13e5157 - { "llama3", 8192 }, - { "gemma", 8192 }, - { "qwen", 32768 }, - { "llama2", 4096 }, - { "codellama", 16384 }, - { "dolphin-mixtral", 32768 }, - { "phi", 2048 }, - { "llama2-uncensored", 2048 }, - { "deepseek-coder", 16384 }, - { "dolphin-mistral", 32768 }, - { "zephyr", 32768 }, - { "starcoder2", 16384 }, - { "dolphin-llama3", 8192 }, - { "orca-mini", 2048 }, - { "yi", 4096 }, - { "mistral-openorca", 32768 }, - { "llava-llama3", 8192 }, - { "starcoder", 8192 }, - { "llama2-chinese", 4096 }, - { "vicuna", 2048 }, // https://ollama.com/library/vicuna:7b-q3_K_S/blobs/a887a7755a1e - { "tinyllama", 2048 }, - { "codestral", 32768 }, - { "wizard-vicuna-uncensored", 2048 }, - { "nous-hermes2", 4096 }, - { "openchat", 8192 }, - { "aya", 8192 }, - { "granite-code", 2048 }, - { "wizardlm2", 32768 }, - { "tinydolphin", 4096 }, - { "wizardcoder", 16384 }, - { "stable-code", 16384 }, - { "openhermes", 32768 }, - { "codeqwen", 65536 }, - { "codegeex4", 131072 }, - { "stablelm2", 4096 }, - { "wizard-math", 2048 }, // https://ollama.com/library/wizard-math:7b-q5_1/blobs/b39818bfe610 - { "qwen2-math", 4096 }, - { "neural-chat", 32768 }, - { "llama3-gradient", 1048576 }, - { "phind-codellama", 16384 }, - { "nous-hermes", 2048 }, // https://ollama.com/library/nous-hermes:13b-q4_1/blobs/433b4abded9b - { "sqlcoder", 8192 }, // https://ollama.com/library/sqlcoder:15b-q8_0/blobs/2319eec9425f - { "dolphincoder", 16384 }, - { "xwinlm", 4096 }, - { "deepseek-llm", 4096 }, - { "yarn-llama2", 65536 }, - { "llama3-chatqa", 8192 }, - { "wizardlm", 2048 }, - { "starling-lm", 8192 }, - { "falcon", 2048 }, - { "orca2", 4096 }, - { "moondream", 2048 }, - { "samantha-mistral", 32768 }, - { "solar", 4096 }, - { "smollm", 2048 }, - { "stable-beluga", 4096 }, - { "dolphin-phi", 2048 }, - { "deepseek-v2", 163840 }, - { "glm4", 8192 }, // https://ollama.com/library/glm4:9b-text-q6_K/blobs/2f657a57a8df - { "phi3.5", 131072 }, - { "bakllava", 32768 }, - { "wizardlm-uncensored", 4096 }, - { "yarn-mistral", 32768 }, // https://ollama.com/library/yarn-mistral/blobs/0e8703041ff2 - { "medllama2", 4096 }, - { "llama-pro", 4096 }, - { "llava-phi3", 4096 }, - { "meditron", 2048 }, - { "nous-hermes2-mixtral", 32768 }, - { "nexusraven", 16384 }, - { "hermes3", 131072 }, - { "codeup", 4096 }, - { "everythinglm", 16384 }, - { "internlm2", 32768 }, - { "magicoder", 16384 }, - { "stablelm-zephyr", 4096 }, - { "codebooga", 16384 }, - { "yi-coder", 131072 }, - { "mistrallite", 32768 }, - { "llama3-groq-tool-use", 8192 }, - { "falcon2", 2048 }, - { "wizard-vicuna", 2048 }, - { "duckdb-nsql", 16384 }, - { "megadolphin", 4096 }, - { "reflection", 8192 }, - { "notux", 32768 }, - { "goliath", 4096 }, - { "open-orca-platypus2", 4096 }, - { "notus", 32768 }, - { "dbrx", 32768 }, - { "mathstral", 32768 }, - { "alfred", 2048 }, - { "nuextract", 4096 }, - { "firefunction-v2", 8192 }, - { "deepseek-v2.5", 163840 }, - // new models - { "minicpm-v", 32768 }, - { "reader-lm", 256000 }, - { "mistral-small", 131072 }, - { "bespoke-minicheck", 32768 }, - { "qwen2.5", 32768 }, - { "nemotron-mini", 4096 }, - { "solar-pro", 4096 }, - { "qwen2.5-coder", 32768 } - }; + private static bool IsOllamaEndpoint = false; + private static bool IsOllamaFetched = false; + private static Dictionary ollamaContextWindowCache = new Dictionary(); - public static int GetContextLength(string modelName) + public static int GetContextLength(string modelName, OpenAIModelCollection availableModels) { if (openAIModelsContextLength.ContainsKey(modelName)) { @@ -155,8 +42,31 @@ public static int GetContextLength(string modelName) } else if (modelName.Contains(':')) { - string key = modelName.Split(':')[0]; - return ollamaModelsContextLength.ContainsKey(key) ? ollamaModelsContextLength[key] : BaselineContextWindowLength; + try + { + if (!IsOllamaFetched) + { + IsOllamaEndpoint = IsOllama(availableModels); + IsOllamaFetched = true; + } + if (IsOllamaEndpoint) + { + int contextWindow; + if (!ollamaContextWindowCache.TryGetValue(modelName, out contextWindow)) + { + contextWindow = GetOllamaModelContextWindow(modelName); + ollamaContextWindowCache[modelName] = contextWindow; + } + return contextWindow; + } else + { + return BaselineContextWindowLength; + } + } catch (OllamaMissingContextWindowException ex) + { + CommonUtils.DisplayWarning(ex); + return BaselineContextWindowLength; + } } else if (modelName.StartsWith("o1")) { @@ -184,10 +94,44 @@ public static int GetContextLength(string modelName) } } - public static IEnumerable GetModelList(ModelClient client) + public static IEnumerable GetModelList(OpenAIModelCollection availableModels) { - OpenAIModelInfoCollection availableModels = client.GetModels().Value; return availableModels.Select(info => info.Id).ToList(); } + + private static bool IsOllama(OpenAIModelCollection availableModels) + { + return (availableModels.Count == 0) ? false : availableModels.First().OwnedBy == "library"; + } + + private static int GetOllamaModelContextWindow(string model) + { + var ollamaEndpoint = ThisAddIn.OpenAIEndpoint.Replace("/v1", ""); + + Ollama ollamaInstance = new Ollama(new Uri(ollamaEndpoint)); + var dict = ollamaInstance.Show(model, true).Result; // or await, if Show() is async + + // Navigate to "model_info" + if (dict.TryGetValue("model_info", out var modelInfoObj) && modelInfoObj is JsonElement modelInfoElement) + { + // Use JsonNode or JsonElement to search for "context_length" key + var modelInfoNode = JsonNode.Parse(modelInfoElement.GetRawText()); + + foreach (var keyValuePair in modelInfoNode.AsObject()) + { + // Search for a nested object containing "context_length" + if (keyValuePair.Key.EndsWith(".context_length")) + { + return int.Parse(keyValuePair.Value.ToString()); + } + } + } + throw new OllamaMissingContextWindowException($"Unable to fetch the context length for {model}!"); + } + } + + public class OllamaMissingContextWindowException : ApplicationException + { + public OllamaMissingContextWindowException(string message) : base(message) { } } } diff --git a/OfficeAddInSetup/OfficeAddInSetup.vdproj b/OfficeAddInSetup/OfficeAddInSetup.vdproj index 093257f..42b3f6f 100644 --- a/OfficeAddInSetup/OfficeAddInSetup.vdproj +++ b/OfficeAddInSetup/OfficeAddInSetup.vdproj @@ -21,6 +21,12 @@ } "Entry" { + "MsmKey" = "8:_0193E69FC0573794FF773890DF0D9885" + "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_04488508DC1347F1B40C3D060AE56275" "OwnerKey" = "8:_BC3C99FDAF63C7C8888DD4CBCDA91900" "MsmSig" = "8:_UNDEFINED" @@ -45,8 +51,20 @@ } "Entry" { + "MsmKey" = "8:_0C70922C764732CFCF075E96C59AFC0B" + "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_0C70922C764732CFCF075E96C59AFC0B" + "OwnerKey" = "8:_568A289CC924B20FDBE264ECD5072F83" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_0D2B853494A572309174FECF1799A7D3" - "OwnerKey" = "8:_C2F42BA801692489F910DED594B693EE" + "OwnerKey" = "8:_8CB774371FF6A8C70E166323B9EB92F9" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -94,43 +112,49 @@ "Entry" { "MsmKey" = "8:_0D2B853494A572309174FECF1799A7D3" - "OwnerKey" = "8:_28DEBDD8B91E8018AD3CCCF8E576365B" + "OwnerKey" = "8:_0C70922C764732CFCF075E96C59AFC0B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_0D2B853494A572309174FECF1799A7D3" - "OwnerKey" = "8:_5EB2A0F3EB10CBA67898753C34F87EBD" + "OwnerKey" = "8:_F52C0159F0DCD0ED2C96201A6B3FE1C1" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_0D2B853494A572309174FECF1799A7D3" - "OwnerKey" = "8:_EB728693CAD8918A0EAB28C472D2B8D2" + "OwnerKey" = "8:_BEDCDB8048630FB7E42416292751A95B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_0D2B853494A572309174FECF1799A7D3" - "OwnerKey" = "8:_EEB1E370A2C174E0CE4DDA1732FADE88" + "OwnerKey" = "8:_EC53AC04EF2A744911E61C7418674BA4" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_0D2B853494A572309174FECF1799A7D3" - "OwnerKey" = "8:_F29B752E0EA7031FA9D796F917760782" + "OwnerKey" = "8:_B57F1471E2C45C10C85EBF14951972E9" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_0D2B853494A572309174FECF1799A7D3" - "OwnerKey" = "8:_7E6AB4C9D0EB589A734A6534537A2EF4" + "OwnerKey" = "8:_8E27D187F943E65FFE9AD2F4C0143661" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_0D2B853494A572309174FECF1799A7D3" - "OwnerKey" = "8:_8E27D187F943E65FFE9AD2F4C0143661" + "OwnerKey" = "8:_C2F42BA801692489F910DED594B693EE" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_10305E80C49B6606B294B92C8CF24706" + "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -159,36 +183,12 @@ } "Entry" { - "MsmKey" = "8:_28DEBDD8B91E8018AD3CCCF8E576365B" - "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_28DEBDD8B91E8018AD3CCCF8E576365B" - "OwnerKey" = "8:_AA498B0298D1CBBEB729614359DDE2B1" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { "MsmKey" = "8:_2A0BF59226F4F78B577AE2DDC9553F98" "OwnerKey" = "8:_5C6B0E1DD3DDFEB1C509E3A5F41B8225" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_2D3AB0270E6A168063D8B06C28CC64BD" - "OwnerKey" = "8:_7E6AB4C9D0EB589A734A6534537A2EF4" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_2D3AB0270E6A168063D8B06C28CC64BD" - "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { "MsmKey" = "8:_2F44424F9CD843DA80F8EDA29E0E1B79" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -238,25 +238,25 @@ "Entry" { "MsmKey" = "8:_4006ACE5B55D5EE6C0BDC813DA2F2979" - "OwnerKey" = "8:_28DEBDD8B91E8018AD3CCCF8E576365B" + "OwnerKey" = "8:_0C70922C764732CFCF075E96C59AFC0B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_4006ACE5B55D5EE6C0BDC813DA2F2979" - "OwnerKey" = "8:_5EB2A0F3EB10CBA67898753C34F87EBD" + "OwnerKey" = "8:_F52C0159F0DCD0ED2C96201A6B3FE1C1" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_4006ACE5B55D5EE6C0BDC813DA2F2979" - "OwnerKey" = "8:_EB728693CAD8918A0EAB28C472D2B8D2" + "OwnerKey" = "8:_BEDCDB8048630FB7E42416292751A95B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_4006ACE5B55D5EE6C0BDC813DA2F2979" - "OwnerKey" = "8:_F29B752E0EA7031FA9D796F917760782" + "OwnerKey" = "8:_B57F1471E2C45C10C85EBF14951972E9" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -321,12 +321,6 @@ } "Entry" { - "MsmKey" = "8:_4452DE0F9A402214897DC4244D4960A1" - "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { "MsmKey" = "8:_47419264F8E9C7478516E89FBAB483C3" "OwnerKey" = "8:_8E27D187F943E65FFE9AD2F4C0143661" "MsmSig" = "8:_UNDEFINED" @@ -352,19 +346,25 @@ "Entry" { "MsmKey" = "8:_47419264F8E9C7478516E89FBAB483C3" - "OwnerKey" = "8:_418EF0BB142EFB592934742842911650" + "OwnerKey" = "8:_10305E80C49B6606B294B92C8CF24706" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_47419264F8E9C7478516E89FBAB483C3" - "OwnerKey" = "8:_2D3AB0270E6A168063D8B06C28CC64BD" + "OwnerKey" = "8:_0193E69FC0573794FF773890DF0D9885" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_47419264F8E9C7478516E89FBAB483C3" - "OwnerKey" = "8:_C2CD9425FBD02E29232D14C86940816B" + "OwnerKey" = "8:_418EF0BB142EFB592934742842911650" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_568A289CC924B20FDBE264ECD5072F83" + "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -382,13 +382,13 @@ "Entry" { "MsmKey" = "8:_5C6B0E1DD3DDFEB1C509E3A5F41B8225" - "OwnerKey" = "8:_C2CD9425FBD02E29232D14C86940816B" + "OwnerKey" = "8:_10305E80C49B6606B294B92C8CF24706" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_5C6B0E1DD3DDFEB1C509E3A5F41B8225" - "OwnerKey" = "8:_2D3AB0270E6A168063D8B06C28CC64BD" + "OwnerKey" = "8:_0193E69FC0573794FF773890DF0D9885" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -405,18 +405,6 @@ } "Entry" { - "MsmKey" = "8:_5EB2A0F3EB10CBA67898753C34F87EBD" - "OwnerKey" = "8:_28DEBDD8B91E8018AD3CCCF8E576365B" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_5EB2A0F3EB10CBA67898753C34F87EBD" - "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { "MsmKey" = "8:_5F058031BE553A3ACE765D873614A95D" "OwnerKey" = "8:_5C6B0E1DD3DDFEB1C509E3A5F41B8225" "MsmSig" = "8:_UNDEFINED" @@ -435,20 +423,14 @@ } "Entry" { - "MsmKey" = "8:_7E6AB4C9D0EB589A734A6534537A2EF4" - "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { "MsmKey" = "8:_7F6D01269308525743C7EC1272A5B76F" "OwnerKey" = "8:_5C6B0E1DD3DDFEB1C509E3A5F41B8225" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_8E27D187F943E65FFE9AD2F4C0143661" - "OwnerKey" = "8:_7E6AB4C9D0EB589A734A6534537A2EF4" + "MsmKey" = "8:_8CB774371FF6A8C70E166323B9EB92F9" + "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -489,18 +471,6 @@ } "Entry" { - "MsmKey" = "8:_A5566B0A2E7D03762124FB7763FBA7DA" - "OwnerKey" = "8:_7E6AB4C9D0EB589A734A6534537A2EF4" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_AA498B0298D1CBBEB729614359DDE2B1" - "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { "MsmKey" = "8:_AA5FC445456EB8400DD5AE895228A445" "OwnerKey" = "8:_D6DCC622A4634ECBD4733DB016770C60" "MsmSig" = "8:_UNDEFINED" @@ -531,6 +501,42 @@ } "Entry" { + "MsmKey" = "8:_B57F1471E2C45C10C85EBF14951972E9" + "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_B57F1471E2C45C10C85EBF14951972E9" + "OwnerKey" = "8:_568A289CC924B20FDBE264ECD5072F83" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_B57F1471E2C45C10C85EBF14951972E9" + "OwnerKey" = "8:_EC53AC04EF2A744911E61C7418674BA4" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_B57F1471E2C45C10C85EBF14951972E9" + "OwnerKey" = "8:_BEDCDB8048630FB7E42416292751A95B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_B57F1471E2C45C10C85EBF14951972E9" + "OwnerKey" = "8:_F52C0159F0DCD0ED2C96201A6B3FE1C1" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_B57F1471E2C45C10C85EBF14951972E9" + "OwnerKey" = "8:_0C70922C764732CFCF075E96C59AFC0B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_B7709F72F8A5334C52367EA6382CF3F1" "OwnerKey" = "8:_0D2B853494A572309174FECF1799A7D3" "MsmSig" = "8:_UNDEFINED" @@ -579,20 +585,20 @@ } "Entry" { - "MsmKey" = "8:_C2CD9425FBD02E29232D14C86940816B" - "OwnerKey" = "8:_2D3AB0270E6A168063D8B06C28CC64BD" + "MsmKey" = "8:_BEDCDB8048630FB7E42416292751A95B" + "OwnerKey" = "8:_F52C0159F0DCD0ED2C96201A6B3FE1C1" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_C2CD9425FBD02E29232D14C86940816B" + "MsmKey" = "8:_BEDCDB8048630FB7E42416292751A95B" "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_C2CD9425FBD02E29232D14C86940816B" - "OwnerKey" = "8:_7E6AB4C9D0EB589A734A6534537A2EF4" + "MsmKey" = "8:_BEDCDB8048630FB7E42416292751A95B" + "OwnerKey" = "8:_0C70922C764732CFCF075E96C59AFC0B" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -627,98 +633,62 @@ } "Entry" { - "MsmKey" = "8:_EB728693CAD8918A0EAB28C472D2B8D2" - "OwnerKey" = "8:_5EB2A0F3EB10CBA67898753C34F87EBD" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_EB728693CAD8918A0EAB28C472D2B8D2" + "MsmKey" = "8:_DDDF68482045A062BEBE5EA5352CEC76" "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_EB728693CAD8918A0EAB28C472D2B8D2" - "OwnerKey" = "8:_28DEBDD8B91E8018AD3CCCF8E576365B" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_EEB1E370A2C174E0CE4DDA1732FADE88" - "OwnerKey" = "8:_EB728693CAD8918A0EAB28C472D2B8D2" + "MsmKey" = "8:_EC53AC04EF2A744911E61C7418674BA4" + "OwnerKey" = "8:_BEDCDB8048630FB7E42416292751A95B" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_EEB1E370A2C174E0CE4DDA1732FADE88" + "MsmKey" = "8:_EC53AC04EF2A744911E61C7418674BA4" "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_EEB1E370A2C174E0CE4DDA1732FADE88" - "OwnerKey" = "8:_28DEBDD8B91E8018AD3CCCF8E576365B" + "MsmKey" = "8:_EC53AC04EF2A744911E61C7418674BA4" + "OwnerKey" = "8:_0C70922C764732CFCF075E96C59AFC0B" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_EEB1E370A2C174E0CE4DDA1732FADE88" - "OwnerKey" = "8:_5EB2A0F3EB10CBA67898753C34F87EBD" + "MsmKey" = "8:_EC53AC04EF2A744911E61C7418674BA4" + "OwnerKey" = "8:_F52C0159F0DCD0ED2C96201A6B3FE1C1" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_F29B752E0EA7031FA9D796F917760782" + "MsmKey" = "8:_F3E0AF9C598F1DB073E2ABA67C9A9266" "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_F29B752E0EA7031FA9D796F917760782" - "OwnerKey" = "8:_AA498B0298D1CBBEB729614359DDE2B1" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_F29B752E0EA7031FA9D796F917760782" - "OwnerKey" = "8:_EEB1E370A2C174E0CE4DDA1732FADE88" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_F29B752E0EA7031FA9D796F917760782" - "OwnerKey" = "8:_EB728693CAD8918A0EAB28C472D2B8D2" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_F29B752E0EA7031FA9D796F917760782" - "OwnerKey" = "8:_5EB2A0F3EB10CBA67898753C34F87EBD" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_F29B752E0EA7031FA9D796F917760782" - "OwnerKey" = "8:_28DEBDD8B91E8018AD3CCCF8E576365B" + "MsmKey" = "8:_F3E0AF9C598F1DB073E2ABA67C9A9266" + "OwnerKey" = "8:_0C70922C764732CFCF075E96C59AFC0B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_F3E0AF9C598F1DB073E2ABA67C9A9266" - "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" + "OwnerKey" = "8:_B57F1471E2C45C10C85EBF14951972E9" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_F3E0AF9C598F1DB073E2ABA67C9A9266" - "OwnerKey" = "8:_28DEBDD8B91E8018AD3CCCF8E576365B" + "MsmKey" = "8:_F52C0159F0DCD0ED2C96201A6B3FE1C1" + "OwnerKey" = "8:_0C70922C764732CFCF075E96C59AFC0B" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_F3E0AF9C598F1DB073E2ABA67C9A9266" - "OwnerKey" = "8:_F29B752E0EA7031FA9D796F917760782" + "MsmKey" = "8:_F52C0159F0DCD0ED2C96201A6B3FE1C1" + "OwnerKey" = "8:_5DA1C96D6C89410AA5F3D85C50EA4EE0" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -784,43 +754,43 @@ "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_4452DE0F9A402214897DC4244D4960A1" + "OwnerKey" = "8:_DDDF68482045A062BEBE5EA5352CEC76" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_AA498B0298D1CBBEB729614359DDE2B1" + "OwnerKey" = "8:_568A289CC924B20FDBE264ECD5072F83" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_28DEBDD8B91E8018AD3CCCF8E576365B" + "OwnerKey" = "8:_0C70922C764732CFCF075E96C59AFC0B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_5EB2A0F3EB10CBA67898753C34F87EBD" + "OwnerKey" = "8:_F52C0159F0DCD0ED2C96201A6B3FE1C1" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_EB728693CAD8918A0EAB28C472D2B8D2" + "OwnerKey" = "8:_BEDCDB8048630FB7E42416292751A95B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_EEB1E370A2C174E0CE4DDA1732FADE88" + "OwnerKey" = "8:_EC53AC04EF2A744911E61C7418674BA4" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_F29B752E0EA7031FA9D796F917760782" + "OwnerKey" = "8:_B57F1471E2C45C10C85EBF14951972E9" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -838,31 +808,31 @@ "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_7E6AB4C9D0EB589A734A6534537A2EF4" + "OwnerKey" = "8:_8E27D187F943E65FFE9AD2F4C0143661" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_8E27D187F943E65FFE9AD2F4C0143661" + "OwnerKey" = "8:_47419264F8E9C7478516E89FBAB483C3" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_47419264F8E9C7478516E89FBAB483C3" + "OwnerKey" = "8:_C2F42BA801692489F910DED594B693EE" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_C2F42BA801692489F910DED594B693EE" + "OwnerKey" = "8:_40C3E7CA56133711000D4294CB9C7F39" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_40C3E7CA56133711000D4294CB9C7F39" + "OwnerKey" = "8:_8CB774371FF6A8C70E166323B9EB92F9" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -1092,6 +1062,37 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_0193E69FC0573794FF773890DF0D9885" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:OpenAI, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b4187f3e65366280, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_0193E69FC0573794FF773890DF0D9885" + { + "Name" = "8:OpenAI.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:OpenAI.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_04488508DC1347F1B40C3D060AE56275" { "AssemblyRegister" = "3:1" @@ -1154,20 +1155,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_0D2B853494A572309174FECF1799A7D3" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_0C70922C764732CFCF075E96C59AFC0B" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig, Version=0.1.9.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL" "ScatterAssemblies" { - "_0D2B853494A572309174FECF1799A7D3" + "_0C70922C764732CFCF075E96C59AFC0B" { - "Name" = "8:System.Memory.dll" + "Name" = "8:UglyToad.PdfPig.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:System.Memory.dll" + "SourcePath" = "8:UglyToad.PdfPig.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1185,20 +1186,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_1B492A5A6CF2F8516B043E501A270AC4" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_0D2B853494A572309174FECF1799A7D3" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.Office.Tools.Common.v4.0.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" "ScatterAssemblies" { - "_1B492A5A6CF2F8516B043E501A270AC4" + "_0D2B853494A572309174FECF1799A7D3" { - "Name" = "8:Microsoft.Office.Tools.Common.v4.0.Utilities.dll" + "Name" = "8:System.Memory.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:Microsoft.Office.Tools.Common.v4.0.Utilities.dll" + "SourcePath" = "8:System.Memory.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1216,20 +1217,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_1C54838A5E8C56DDA4C7F6B4B6DAE133" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_10305E80C49B6606B294B92C8CF24706" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:System.Text.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:System.ClientModel, Version=1.2.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL" "ScatterAssemblies" { - "_1C54838A5E8C56DDA4C7F6B4B6DAE133" + "_10305E80C49B6606B294B92C8CF24706" { - "Name" = "8:System.Text.Json.dll" + "Name" = "8:System.ClientModel.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:System.Text.Json.dll" + "SourcePath" = "8:System.ClientModel.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1247,10 +1248,21 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_25ED0A801C564A729331D11069ED0745" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_1B492A5A6CF2F8516B043E501A270AC4" { - "SourcePath" = "8:..\\Resources\\robot_color.ico" - "TargetName" = "8:robot_color.ico" + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Microsoft.Office.Tools.Common.v4.0.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_1B492A5A6CF2F8516B043E501A270AC4" + { + "Name" = "8:Microsoft.Office.Tools.Common.v4.0.Utilities.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Microsoft.Office.Tools.Common.v4.0.Utilities.dll" + "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" "Condition" = "8:" @@ -1264,23 +1276,23 @@ "PackageAs" = "3:1" "Register" = "3:1" "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" + "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_28DEBDD8B91E8018AD3CCCF8E576365B" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_1C54838A5E8C56DDA4C7F6B4B6DAE133" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig, Version=0.1.9.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:System.Text.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" "ScatterAssemblies" { - "_28DEBDD8B91E8018AD3CCCF8E576365B" + "_1C54838A5E8C56DDA4C7F6B4B6DAE133" { - "Name" = "8:UglyToad.PdfPig.dll" + "Name" = "8:System.Text.Json.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:UglyToad.PdfPig.dll" + "SourcePath" = "8:System.Text.Json.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1298,21 +1310,10 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_2A0BF59226F4F78B577AE2DDC9553F98" + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_25ED0A801C564A729331D11069ED0745" { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:TRUE" - "AssemblyAsmDisplayName" = "8:System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_2A0BF59226F4F78B577AE2DDC9553F98" - { - "Name" = "8:System.Net.Http.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:System.Net.Http.dll" - "TargetName" = "8:" + "SourcePath" = "8:..\\Resources\\robot_color.ico" + "TargetName" = "8:robot_color.ico" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" "Condition" = "8:" @@ -1326,23 +1327,23 @@ "PackageAs" = "3:1" "Register" = "3:1" "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" + "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_2D3AB0270E6A168063D8B06C28CC64BD" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_2A0BF59226F4F78B577AE2DDC9553F98" { "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:OpenAI, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b4187f3e65366280, processorArchitecture=MSIL" + "AssemblyIsInGAC" = "11:TRUE" + "AssemblyAsmDisplayName" = "8:System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" "ScatterAssemblies" { - "_2D3AB0270E6A168063D8B06C28CC64BD" + "_2A0BF59226F4F78B577AE2DDC9553F98" { - "Name" = "8:OpenAI.dll" + "Name" = "8:System.Net.Http.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:OpenAI.dll" + "SourcePath" = "8:System.Net.Http.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1473,20 +1474,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_4452DE0F9A402214897DC4244D4960A1" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_47419264F8E9C7478516E89FBAB483C3" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig.Package, Version=0.1.8.0, Culture=neutral, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" "ScatterAssemblies" { - "_4452DE0F9A402214897DC4244D4960A1" + "_47419264F8E9C7478516E89FBAB483C3" { - "Name" = "8:UglyToad.PdfPig.Package.dll" + "Name" = "8:System.Threading.Tasks.Extensions.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:UglyToad.PdfPig.Package.dll" + "SourcePath" = "8:System.Threading.Tasks.Extensions.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1504,20 +1505,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_47419264F8E9C7478516E89FBAB483C3" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_568A289CC924B20FDBE264ECD5072F83" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig.DocumentLayoutAnalysis, Version=0.1.9.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL" "ScatterAssemblies" { - "_47419264F8E9C7478516E89FBAB483C3" + "_568A289CC924B20FDBE264ECD5072F83" { - "Name" = "8:System.Threading.Tasks.Extensions.dll" + "Name" = "8:UglyToad.PdfPig.DocumentLayoutAnalysis.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:System.Threading.Tasks.Extensions.dll" + "SourcePath" = "8:UglyToad.PdfPig.DocumentLayoutAnalysis.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1586,37 +1587,6 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_5EB2A0F3EB10CBA67898753C34F87EBD" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig.Fonts, Version=0.1.9.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_5EB2A0F3EB10CBA67898753C34F87EBD" - { - "Name" = "8:UglyToad.PdfPig.Fonts.dll" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:UglyToad.PdfPig.Fonts.dll" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:TRUE" - "IsolateTo" = "8:" - } "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_5F058031BE553A3ACE765D873614A95D" { "AssemblyRegister" = "3:1" @@ -1710,20 +1680,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_7E6AB4C9D0EB589A734A6534537A2EF4" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_7F6D01269308525743C7EC1272A5B76F" { "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:HyperVectorDB, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL" + "AssemblyIsInGAC" = "11:TRUE" + "AssemblyAsmDisplayName" = "8:System.Diagnostics.Tracing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" "ScatterAssemblies" { - "_7E6AB4C9D0EB589A734A6534537A2EF4" + "_7F6D01269308525743C7EC1272A5B76F" { - "Name" = "8:HyperVectorDB.dll" + "Name" = "8:System.Diagnostics.Tracing.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:HyperVectorDB.dll" + "SourcePath" = "8:System.Diagnostics.Tracing.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1741,20 +1711,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_7F6D01269308525743C7EC1272A5B76F" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_8CB774371FF6A8C70E166323B9EB92F9" { "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:TRUE" - "AssemblyAsmDisplayName" = "8:System.Diagnostics.Tracing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:HyperVectorDB, Version=1.0.6.0, Culture=neutral, processorArchitecture=MSIL" "ScatterAssemblies" { - "_7F6D01269308525743C7EC1272A5B76F" + "_8CB774371FF6A8C70E166323B9EB92F9" { - "Name" = "8:System.Diagnostics.Tracing.dll" + "Name" = "8:HyperVectorDB.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:System.Diagnostics.Tracing.dll" + "SourcePath" = "8:HyperVectorDB.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1885,20 +1855,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_AA498B0298D1CBBEB729614359DDE2B1" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_AA5FC445456EB8400DD5AE895228A445" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig.DocumentLayoutAnalysis, Version=0.1.9.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.Tools.Applications.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" "ScatterAssemblies" { - "_AA498B0298D1CBBEB729614359DDE2B1" + "_AA5FC445456EB8400DD5AE895228A445" { - "Name" = "8:UglyToad.PdfPig.DocumentLayoutAnalysis.dll" + "Name" = "8:Microsoft.VisualStudio.Tools.Applications.Runtime.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:UglyToad.PdfPig.DocumentLayoutAnalysis.dll" + "SourcePath" = "8:Microsoft.VisualStudio.Tools.Applications.Runtime.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1916,20 +1886,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_AA5FC445456EB8400DD5AE895228A445" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_AD3F8C308B298A3E9BB78BC9A90BB895" { "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.VisualStudio.Tools.Applications.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" + "AssemblyIsInGAC" = "11:TRUE" + "AssemblyAsmDisplayName" = "8:System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" "ScatterAssemblies" { - "_AA5FC445456EB8400DD5AE895228A445" + "_AD3F8C308B298A3E9BB78BC9A90BB895" { - "Name" = "8:Microsoft.VisualStudio.Tools.Applications.Runtime.dll" + "Name" = "8:System.IO.Compression.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:Microsoft.VisualStudio.Tools.Applications.Runtime.dll" + "SourcePath" = "8:System.IO.Compression.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1947,20 +1917,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_AD3F8C308B298A3E9BB78BC9A90BB895" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_B24F90FE2EF8A3CCDFD5E60912F2F1AF" { "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:TRUE" - "AssemblyAsmDisplayName" = "8:System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:System.Memory.Data, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" "ScatterAssemblies" { - "_AD3F8C308B298A3E9BB78BC9A90BB895" + "_B24F90FE2EF8A3CCDFD5E60912F2F1AF" { - "Name" = "8:System.IO.Compression.dll" + "Name" = "8:System.Memory.Data.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:System.IO.Compression.dll" + "SourcePath" = "8:System.Memory.Data.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -1978,20 +1948,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_B24F90FE2EF8A3CCDFD5E60912F2F1AF" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_B57F1471E2C45C10C85EBF14951972E9" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:System.Memory.Data, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig.Core, Version=0.1.9.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL" "ScatterAssemblies" { - "_B24F90FE2EF8A3CCDFD5E60912F2F1AF" + "_B57F1471E2C45C10C85EBF14951972E9" { - "Name" = "8:System.Memory.Data.dll" + "Name" = "8:UglyToad.PdfPig.Core.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:System.Memory.Data.dll" + "SourcePath" = "8:UglyToad.PdfPig.Core.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -2142,20 +2112,20 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_C2CD9425FBD02E29232D14C86940816B" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_BEDCDB8048630FB7E42416292751A95B" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:System.ClientModel, Version=1.1.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig.Tokenization, Version=0.1.9.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL" "ScatterAssemblies" { - "_C2CD9425FBD02E29232D14C86940816B" + "_BEDCDB8048630FB7E42416292751A95B" { - "Name" = "8:System.ClientModel.dll" + "Name" = "8:UglyToad.PdfPig.Tokenization.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:System.ClientModel.dll" + "SourcePath" = "8:UglyToad.PdfPig.Tokenization.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -2266,20 +2236,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_EB728693CAD8918A0EAB28C472D2B8D2" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_DDDF68482045A062BEBE5EA5352CEC76" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig.Tokenization, Version=0.1.9.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig.Package, Version=0.1.8.0, Culture=neutral, processorArchitecture=MSIL" "ScatterAssemblies" { - "_EB728693CAD8918A0EAB28C472D2B8D2" + "_DDDF68482045A062BEBE5EA5352CEC76" { - "Name" = "8:UglyToad.PdfPig.Tokenization.dll" + "Name" = "8:UglyToad.PdfPig.Package.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:UglyToad.PdfPig.Tokenization.dll" + "SourcePath" = "8:UglyToad.PdfPig.Package.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -2297,14 +2267,14 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_EEB1E370A2C174E0CE4DDA1732FADE88" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_EC53AC04EF2A744911E61C7418674BA4" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig.Tokens, Version=0.1.9.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL" "ScatterAssemblies" { - "_EEB1E370A2C174E0CE4DDA1732FADE88" + "_EC53AC04EF2A744911E61C7418674BA4" { "Name" = "8:UglyToad.PdfPig.Tokens.dll" "Attributes" = "3:512" @@ -2328,20 +2298,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F29B752E0EA7031FA9D796F917760782" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F3E0AF9C598F1DB073E2ABA67C9A9266" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig.Core, Version=0.1.9.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:Microsoft.Bcl.HashCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" "ScatterAssemblies" { - "_F29B752E0EA7031FA9D796F917760782" + "_F3E0AF9C598F1DB073E2ABA67C9A9266" { - "Name" = "8:UglyToad.PdfPig.Core.dll" + "Name" = "8:Microsoft.Bcl.HashCode.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:UglyToad.PdfPig.Core.dll" + "SourcePath" = "8:Microsoft.Bcl.HashCode.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -2359,20 +2329,20 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F3E0AF9C598F1DB073E2ABA67C9A9266" + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F52C0159F0DCD0ED2C96201A6B3FE1C1" { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:Microsoft.Bcl.HashCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:UglyToad.PdfPig.Fonts, Version=0.1.9.0, Culture=neutral, PublicKeyToken=605d367334e74123, processorArchitecture=MSIL" "ScatterAssemblies" { - "_F3E0AF9C598F1DB073E2ABA67C9A9266" + "_F52C0159F0DCD0ED2C96201A6B3FE1C1" { - "Name" = "8:Microsoft.Bcl.HashCode.dll" + "Name" = "8:UglyToad.PdfPig.Fonts.dll" "Attributes" = "3:512" } } - "SourcePath" = "8:Microsoft.Bcl.HashCode.dll" + "SourcePath" = "8:UglyToad.PdfPig.Fonts.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_AF016B7856C74F08A06EC9F3AA46C574" @@ -2500,15 +2470,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:TextCraft" - "ProductCode" = "8:{15612664-6E52-4467-AB1D-A6A61912EB5F}" - "PackageCode" = "8:{F2373BEB-832C-43B4-B577-2F320EF122FD}" + "ProductCode" = "8:{42DA3A94-FC29-41F2-A4F9-9D960D340B5A}" + "PackageCode" = "8:{59749625-27E7-4194-AF35-981CEE5DCAC4}" "UpgradeCode" = "8:{E36CBC33-F0C8-472A-99B5-D882A25CC883}" "AspNetVersion" = "8:" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:1.0.3" + "ProductVersion" = "8:1.0.4" "Manufacturer" = "8:suncloudsmoon" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:https://github.com/suncloudsmoon/TextCraft" diff --git a/Ollama.cs b/Ollama.cs new file mode 100644 index 0000000..e281683 --- /dev/null +++ b/Ollama.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; + +namespace TextForge +{ + internal class Ollama + { + private Uri _endpoint; + private static readonly Uri _showApiRelativeUri = new Uri("api/show", UriKind.Relative); + + public Ollama(Uri endpoint) + { + _endpoint = endpoint; + } + + public async Task> Show(string modelName, bool verbose = false) + { + Uri fullUri = new Uri(_endpoint, _showApiRelativeUri); + + // Create the request payload + var payload = new + { + name = modelName, + verbose = verbose + }; + + // Serialize the payload to JSON using System.Text.Json + var jsonPayload = JsonSerializer.Serialize(payload); + + // Create a StringContent object to send the payload + var content = new StringContent(jsonPayload, Encoding.UTF8, "application/json"); + + try + { + // Send the POST request + var response = await CommonUtils.client.PostAsync(fullUri.OriginalString, content); + response.EnsureSuccessStatusCode(); + + // Read the response content as a string + var responseString = await response.Content.ReadAsStringAsync(); + + // Deserialize the JSON response into a Dictionary + var responseData = JsonSerializer.Deserialize>(responseString); + + return responseData; + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + return null; + } + } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index e1d233f..5b74a1f 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.3.0")] -[assembly: AssemblyFileVersion("1.0.3.0")] +[assembly: AssemblyVersion("1.0.4.0")] +[assembly: AssemblyFileVersion("1.0.4.0")] diff --git a/RAGControl.cs b/RAGControl.cs index f5c22c8..4954726 100644 --- a/RAGControl.cs +++ b/RAGControl.cs @@ -31,7 +31,7 @@ public partial class RAGControl : UserControl private HyperVectorDB.HyperVectorDB _db; private bool _isIndexing; private readonly object progressBarLock = new object(); - + public RAGControl() { try diff --git a/README.md b/README.md index 9612c1b..0452e08 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ To install TextCraft, the Office® Add-In with integrated AI tools, follow these 4. **Pull** an embedding model of your choice, for example: - `ollama pull all-minilm` 6. **Download the appropriate setup file:** - - For a 32-bit system, download [`TextCraft_x32.zip`](https://github.com/suncloudsmoon/TextCraft/releases/download/v1.0.3/TextCraft_x32.zip). - - For a 64-bit system, download [`TextCraft_x64.zip`](https://github.com/suncloudsmoon/TextCraft/releases/download/v1.0.3/TextCraft_x64.zip). + - For a 32-bit system, download [`TextCraft_x32.zip`](https://github.com/suncloudsmoon/TextCraft/releases/download/v1.0.4/TextCraft_x32.zip). + - For a 64-bit system, download [`TextCraft_x64.zip`](https://github.com/suncloudsmoon/TextCraft/releases/download/v1.0.4/TextCraft_x64.zip). 7. **Extract the contents** of the downloaded zip file to a folder of your choice. 8. **Run** `setup.exe`: This will install any required dependencies for TextCraft, including .NET Framework® 4.8.1 and Visual Studio® 2010 Tools for Office Runtime. 9. **Run** `OfficeAddInSetup.msi` to install TextCraft. diff --git a/TextCraft.csproj b/TextCraft.csproj index 97be0df..bbbd2b7 100644 --- a/TextCraft.csproj +++ b/TextCraft.csproj @@ -130,8 +130,8 @@ --> - - packages\HyperVectorDB-APIFixes.1.0.5\lib\net481\HyperVectorDB.dll + + packages\HyperVectorDB-APIFixes.1.0.6\lib\net481\HyperVectorDB.dll packages\MessagePack.3.0.134-beta\lib\net472\MessagePack.dll @@ -148,19 +148,20 @@ packages\Microsoft.NET.StringTools.17.11.4\lib\net472\Microsoft.NET.StringTools.dll - - packages\OpenAI.2.0.0-beta.12\lib\netstandard2.0\OpenAI.dll + + packages\OpenAI.2.1.0-beta.1\lib\netstandard2.0\OpenAI.dll packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - packages\System.ClientModel.1.1.0\lib\netstandard2.0\System.ClientModel.dll + + packages\System.ClientModel.1.2.0\lib\netstandard2.0\System.ClientModel.dll packages\System.Collections.Immutable.9.0.0-rc.1.24431.7\lib\net462\System.Collections.Immutable.dll + packages\System.Diagnostics.DiagnosticSource.9.0.0-rc.1.24431.7\lib\net462\System.Diagnostics.DiagnosticSource.dll @@ -202,25 +203,25 @@ - packages\PdfPig.0.1.9-alpha-20240910-4845f\lib\net471\UglyToad.PdfPig.dll + packages\PdfPig.0.1.9-alpha-20240930-eb9a1\lib\net471\UglyToad.PdfPig.dll - packages\PdfPig.0.1.9-alpha-20240910-4845f\lib\net471\UglyToad.PdfPig.Core.dll + packages\PdfPig.0.1.9-alpha-20240930-eb9a1\lib\net471\UglyToad.PdfPig.Core.dll - packages\PdfPig.0.1.9-alpha-20240910-4845f\lib\net471\UglyToad.PdfPig.DocumentLayoutAnalysis.dll + packages\PdfPig.0.1.9-alpha-20240930-eb9a1\lib\net471\UglyToad.PdfPig.DocumentLayoutAnalysis.dll - packages\PdfPig.0.1.9-alpha-20240910-4845f\lib\net471\UglyToad.PdfPig.Fonts.dll + packages\PdfPig.0.1.9-alpha-20240930-eb9a1\lib\net471\UglyToad.PdfPig.Fonts.dll - packages\PdfPig.0.1.9-alpha-20240910-4845f\lib\net471\UglyToad.PdfPig.Package.dll + packages\PdfPig.0.1.9-alpha-20240930-eb9a1\lib\net471\UglyToad.PdfPig.Package.dll - packages\PdfPig.0.1.9-alpha-20240910-4845f\lib\net471\UglyToad.PdfPig.Tokenization.dll + packages\PdfPig.0.1.9-alpha-20240930-eb9a1\lib\net471\UglyToad.PdfPig.Tokenization.dll - packages\PdfPig.0.1.9-alpha-20240910-4845f\lib\net471\UglyToad.PdfPig.Tokens.dll + packages\PdfPig.0.1.9-alpha-20240930-eb9a1\lib\net471\UglyToad.PdfPig.Tokens.dll @@ -319,6 +320,7 @@ GenerateUserControl.cs + Form diff --git a/ThisAddIn.cs b/ThisAddIn.cs index 2e55ff1..f43a32d 100644 --- a/ThisAddIn.cs +++ b/ThisAddIn.cs @@ -1,11 +1,12 @@ using System; +using System.ClientModel; using System.Collections.Generic; using System.Linq; using System.Threading; +using System.Threading.Tasks; using HyperVectorDB.Embedder; using OpenAI; using OpenAI.Models; -using System.ClientModel; using Word = Microsoft.Office.Interop.Word; namespace TextForge @@ -23,7 +24,7 @@ public partial class ThisAddIn public static RAGControl RagControl { get { return _ragControl; } } public static CancellationTokenSource CancellationTokenSource { get { return _cancellationTokenSource; } set { _cancellationTokenSource = value; } } public static bool IsAddinInitialized { get { return _isAddinInitialized; } set { _isAddinInitialized = value; } } - public static IEnumerable ModelList { get { return _modelList; } } + public static OpenAIModelCollection ModelList { get { return _modelList; } } // Private private static string _openAIEndpoint = "http://localhost:11434/v1"; // Ollama endpoint @@ -36,7 +37,7 @@ public partial class ThisAddIn private static CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource(); private static RAGControl _ragControl; private static bool _isAddinInitialized = false; - private static IEnumerable _modelList; + private static OpenAIModelCollection _modelList; private void ThisAddIn_Startup(object sender, System.EventArgs e) { @@ -84,40 +85,29 @@ private static void InitializeEnvironmentVariables() { Endpoint = new Uri(_openAIEndpoint), ProjectId = "Operation Clippy", - ApplicationId = "TextCraft" + UserAgentApplicationId = "TextCraft" }; - ModelClient modelRetriever = new ModelClient(new ApiKeyCredential(_apiKey), _clientOptions); - _modelList = ModelProperties.GetModelList(modelRetriever); // caching the response + OpenAIModelClient modelRetriever = new OpenAIModelClient(new ApiKeyCredential(_apiKey), _clientOptions); + _modelList = modelRetriever.GetModels().Value; string defaultModel = Properties.Settings.Default.DefaultModel; - _model = _modelList.Contains(defaultModel) ? defaultModel : _modelList.First(); - _contextLength = ModelProperties.GetContextLength(_model); + _model = _modelList.Any(model => model.Id == defaultModel) ? defaultModel : _modelList.First().Id; + _contextLength = ModelProperties.GetContextLength(_model, _modelList); // Set embed model SetEmbedModelAutomatically(); } - private static void SetEmbedModelAutomatically() { + private static void SetEmbedModelAutomatically() + { if (string.IsNullOrEmpty(_embedModel)) { - foreach (var model in _modelList) - { - if (model.Contains("embed")) - { - _embedModel = model; - break; - } else - { - foreach (var item in ModelProperties.UniqueEmbedModels) - { - if (model.Contains(item)) - { - _embedModel = model; - break; - } - } - } - } + // Use LINQ to find the first model that meets the condition + _embedModel = _modelList.FirstOrDefault(model => + model.Id.Contains("embed") || ModelProperties.UniqueEmbedModels.Any(item => model.Id.Contains(item)) + )?.Id; + + // If no model was found, throw an exception if (string.IsNullOrEmpty(_embedModel)) throw new ArgumentException("Embed model is not installed on the computer!"); } diff --git a/WordMarkdown.cs b/WordMarkdown.cs index 8e419e4..d6c3da9 100644 --- a/WordMarkdown.cs +++ b/WordMarkdown.cs @@ -10,8 +10,6 @@ namespace TextForge { internal class WordMarkdown { - private static readonly HttpClient client = new HttpClient(); - private static readonly Dictionary Keywords = new Dictionary { ["python"] = new[] @@ -476,7 +474,7 @@ private static void ApplyImageFormatting(Word.Range formatRange, string imageUrl } // Download the image data - byte[] imageBytes = Task.Run(() => client.GetByteArrayAsync(imageUrl)).Result; + byte[] imageBytes = Task.Run(() => CommonUtils.client.GetByteArrayAsync(imageUrl)).Result; // Create a temporary file string tempFilePath = System.IO.Path.GetTempFileName(); diff --git a/app.config b/app.config index 0fc27e1..fdaf41e 100644 --- a/app.config +++ b/app.config @@ -21,7 +21,7 @@ - + @@ -59,6 +59,14 @@ + + + + + + + + diff --git a/packages.config b/packages.config index ba6e123..37366cc 100644 --- a/packages.config +++ b/packages.config @@ -1,16 +1,16 @@  - + - - + + - +