Fix
This commit is contained in:
parent
ac94ae08f9
commit
4505d50a11
@ -120,8 +120,6 @@ func RequestAnthropic(model string, messages []Message, maxTokens int, temperatu
|
||||
return AnthropicChatCompletionResponse{}, fmt.Errorf("error getting Anthropic API key: %w", err)
|
||||
}
|
||||
|
||||
fmt.Println("apiKey:", apiKey)
|
||||
|
||||
url := "https://api.anthropic.com/v1/messages"
|
||||
|
||||
requestBody := AnthropicChatCompletionRequest{
|
||||
|
16
login.go
16
login.go
@ -1,14 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/edgedb/edgedb-go"
|
||||
@ -161,17 +159,7 @@ func handleCallback(c *fiber.Ctx) error {
|
||||
|
||||
func handleSignOut(c *fiber.Ctx) error {
|
||||
c.ClearCookie("jade-edgedb-auth-token")
|
||||
edgeClient.Close()
|
||||
edgeClient = edgeClient.WithoutGlobals("ext::auth::client_token")
|
||||
|
||||
var ctx = context.Background()
|
||||
client, err := edgedb.CreateClient(ctx, edgedb.Options{})
|
||||
if err != nil {
|
||||
fmt.Println("Error in edgedb.CreateClient: in init")
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
edgeCtx = ctx
|
||||
edgeClient = client
|
||||
|
||||
return c.Redirect("/", fiber.StatusPermanentRedirect)
|
||||
return c.Redirect("/", fiber.StatusTemporaryRedirect)
|
||||
}
|
||||
|
4
main.go
4
main.go
@ -126,7 +126,7 @@ func main() {
|
||||
c.Context().SetBodyStreamWriter(func(w *bufio.Writer) {
|
||||
for event := range events {
|
||||
if _, err := fmt.Fprintf(w, "event: %s\ndata: %s\n\n", event.Event, event.Data); err != nil {
|
||||
return
|
||||
panic(err)
|
||||
}
|
||||
w.Flush()
|
||||
}
|
||||
@ -136,7 +136,7 @@ func main() {
|
||||
})
|
||||
|
||||
// Start server
|
||||
log.Fatal(app.Listen(":3000"))
|
||||
log.Fatal(app.Listen(":8080"))
|
||||
}
|
||||
|
||||
func addKeys(c *fiber.Ctx) error {
|
||||
|
@ -10,10 +10,10 @@
|
||||
<table class="table is-hoverable is-fullwidth is-narrow is-small">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="is-size-7" style="width: 30%;">Name</th>
|
||||
<th class="is-size-7" style="width: 30%;">Model</th>
|
||||
<th class="is-size-7" style="width: 10%;"></th>
|
||||
<th class="is-size-7" style="width: 10%;"></th>
|
||||
<th class="is-size-7">Name</th>
|
||||
<th class="is-size-7">Model</th>
|
||||
<th class="is-size-7"></th>
|
||||
<th class="is-size-7"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
Loading…
x
Reference in New Issue
Block a user