-
add
.env
file in the root dir (like this)API_KEY=your_apikey PROXY_URL=http://127.0.0.1:7890
-
Simple Get Text Reply
package main import ( "context" "fmt" "gemini-go/client" ) func main() { ctx, cancel := context.WithCancel(context.Background()) tx := client.Init().GetTextFunc() contents := []client.Content{ { Role: "user", Parts: []client.Text{{"帮我写一段故事"}}, }, } s := tx.Chat(contents, ctx) fmt.Println(s) cancel() }
-
Stream Mode
- Common Msg Reply
- Stream Msg Reply
- Image Vision
change vpn area to USA