This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "flag" | |
| "io" | |
| "log" | |
| "net/http" | |
| "net/url" | |
| "time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from agno.agent import Agent, AgentMemory | |
| from agno.models.google import Gemini | |
| from agno.tools.duckduckgo import DuckDuckGoTools | |
| from agno.tools.file import FileTools | |
| from agno.memory.db.sqlite import SqliteMemoryDb | |
| from agno.memory.summarizer import MemorySummarizer | |
| from agno.memory.classifier import MemoryClassifier | |
| from agno.storage.agent.sqlite import SqliteAgentStorage | |
| gemini_model = Gemini(id="gemini-2.0-flash-exp", api_key="") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| "os" | |
| "sync" | |
| "time" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| "os" | |
| "time" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| "os" | |
| ) | |
| func main() { | |
| listen, err := net.Listen("tcp", "127.0.0.1:8080") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| "net/http" | |
| ) | |
| type myHandler struct { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "net/http/httptrace" | |
| "time" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type InMemListener struct { | |
| connCh chan net.Conn | |
| } | |
| func newInMemListener() *InMemListener { | |
| return &InMemListener{ | |
| connCh: make(chan net.Conn, 1), | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func TestHttpServer(t *testing.T) { | |
| mux := http.NewServeMux() | |
| mux.HandleFunc("/test", func(w http.ResponseWriter, r *http.Request) { | |
| w.Write([]byte("OK")) | |
| }) | |
| srv := httptest.NewUnstartedServer(mux) | |
| srv.Start() | |
| time.Sleep(1 * time.Second) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func newLocalListener() net.Listener { | |
| if serveFlag != "" { | |
| l, err := net.Listen("tcp", serveFlag) | |
| if err != nil { | |
| panic(fmt.Sprintf("httptest: failed to listen on %v: %v", serveFlag, err)) | |
| } | |
| return l | |
| } | |
| l, err := net.Listen("tcp", "127.0.0.1:0") | |
| if err != nil { |
NewerOlder