feat(llm): add LLM integration instructions and handler
* Serve LLM instructions at `/llm` * Include markdown content for memory instructions * Update README with LLM integration details * Add tests for LLM instructions handler * Modify database migrations to use GUIDs for thoughts and projects
This commit is contained in:
29
internal/app/llm_test.go
Normal file
29
internal/app/llm_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
amcsllm "git.warky.dev/wdevs/amcs/llm"
|
||||
)
|
||||
|
||||
func TestServeLLMInstructions(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodGet, "/llm", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
|
||||
serveLLMInstructions(rec, req)
|
||||
|
||||
res := rec.Result()
|
||||
defer res.Body.Close()
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
t.Fatalf("status = %d, want %d", res.StatusCode, http.StatusOK)
|
||||
}
|
||||
if got := res.Header.Get("Content-Type"); got != "text/markdown; charset=utf-8" {
|
||||
t.Fatalf("content-type = %q, want %q", got, "text/markdown; charset=utf-8")
|
||||
}
|
||||
if body := rec.Body.String(); body != string(amcsllm.MemoryInstructions) {
|
||||
t.Fatalf("body = %q, want embedded instructions", body)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user