summaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'server.go')
-rw-r--r--server.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/server.go b/server.go
new file mode 100644
index 0000000..2e25559
--- /dev/null
+++ b/server.go
@@ -0,0 +1,27 @@
+package main
+
+import (
+ "fmt"
+ "net/http"
+)
+
+// create server
+// listen to the completion endpoint handler
+
+func completion(w http.ResponseWriter, req *http.Request) {
+ // post request
+ body := req.Body
+ // get body as io.reader
+ // pass it to the /completion
+ go sendMsgToLLM(body)
+out:
+ for {
+ select {
+ case chunk := <-chunkChan:
+ fmt.Println(chunk)
+ case <-streamDone:
+ break out
+ }
+ }
+ return
+}