modulepackage
0.1.21
Repository: https://github.com/meinside/gemini-things-go.git
Documentation: pkg.go.dev
# README
gemini-things-go
A helper library for generating things with Gemini API.
Usage
See the code examples in the generation_test.go file.
Test
$ API_KEY="AIabcdefghijklmnopqrstuvwxyz_ABCDEFG-00000000-00" go test
# for verbose output:
$ API_KEY="AIabcdefghijklmnopqrstuvwxyz_ABCDEFG-00000000-00" VERBOSE=true go test
# Functions
ErrToStr converts error (possibly goolge api error) to string.
FuncArg searches for and returns a value with given `key` from the function call arguments `from`.
NewClient returns a new client with given values.
NewGenerationOptions returns a new GenerationOptions with default values.
SupportedMimeType detects and returns the matched mime type of given bytes data and whether it's supported or not.
SupportedMimeTypePath detects and returns the matched mime type of given path and whether it's supported or not.
# Structs
Client struct.
GenerationOptions struct for function Generate.
NumTokens struct for input/output token numbers.
StreamCallbackData struct contains the data for stream callback function.