From 2a024799287ac3102dfa478afb53aaaf3518c7a8 Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Sun, 26 Jan 2025 22:33:41 +0900 Subject: [PATCH 1/2] style: Improve formatting in Ollama request method Signed-off-by: HAHWUL --- src/llm/ollama/ollama.cr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/llm/ollama/ollama.cr b/src/llm/ollama/ollama.cr index 9c871a4d..fc6bc583 100644 --- a/src/llm/ollama/ollama.cr +++ b/src/llm/ollama/ollama.cr @@ -10,11 +10,11 @@ module LLM def request(prompt : String, format : String = "json") body = { - :model => @model, - :prompt => prompt, - :stream => false, + :model => @model, + :prompt => prompt, + :stream => false, :temperature => 0.3, - :format => format == "json" ? "json" : JSON.parse(format) + :format => format == "json" ? "json" : JSON.parse(format), } response = Crest.post(@api, body, json: true) From f21abd5c4c7ea9c3d3b4159a17e70e6819115bc1 Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Sun, 26 Jan 2025 22:40:44 +0900 Subject: [PATCH 2/2] test: Add unit tests for completion script generation methods Signed-off-by: HAHWUL --- spec/unit_test/completions_spec.cr | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 spec/unit_test/completions_spec.cr diff --git a/spec/unit_test/completions_spec.cr b/spec/unit_test/completions_spec.cr new file mode 100644 index 00000000..63b48ced --- /dev/null +++ b/spec/unit_test/completions_spec.cr @@ -0,0 +1,15 @@ +require "../../src/completions" + +describe "Completion Script Generation" do + it "has a generate_zsh_completion_script method" do + generate_zsh_completion_script.size.should be > 0 + end + + it "has a generate_bash_completion_script method" do + generate_bash_completion_script.size.should be > 0 + end + + it "has a generate_fish_completion_script method" do + generate_fish_completion_script.size.should be > 0 + end +end