StreamAdapter adapts the Gemini streaming iterator to chat.MessageStream
| 22 | |
| 23 | // StreamAdapter adapts the Gemini streaming iterator to chat.MessageStream |
| 24 | type StreamAdapter struct { |
| 25 | iter func(func(*genai.GenerateContentResponse, error) bool) |
| 26 | ch chan result |
| 27 | done chan struct{} |
| 28 | startOnce sync.Once |
| 29 | closeOnce sync.Once |
| 30 | model string |
| 31 | trackUsage bool |
| 32 | } |
| 33 | |
| 34 | type result struct { |
| 35 | resp *genai.GenerateContentResponse |
nothing calls this directly
no outgoing calls
no test coverage detected