Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jba committed Jul 10, 2024
1 parent 7ace772 commit cfc27d0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions genai/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ type clientInfo struct {
key, value string
}

// optionOfType returns the first value of opts that has type T,
// along with true. If there is no option of that type, it returns
// the zero value for T and false.
func optionOfType[T option.ClientOption](opts []option.ClientOption) (T, bool) {
for _, opt := range opts {
if opt, ok := opt.(T); ok {
Expand Down

0 comments on commit cfc27d0

Please sign in to comment.