whatsapp_chatgpt_go

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 14 Imported by: 3

README

WhatsApp GPT Bot Go Library

A modern, state-based WhatsApp bot library with OpenAI GPT integration, built on top of GREEN-API's WhatsApp chatbot library for Golang.

Features

  • OpenAI GPT model integration for intelligent responses
  • Support for multiple GPT models (GPT-3.5, GPT-4, GPT-4o, O1)
  • Multimodal capabilities with image processing support
  • Voice message transcription
  • Comprehensive message handling for various WhatsApp message types
  • Middleware architecture for customizing message and response processing
  • Built-in conversation history management

Installation

go get github.com/green-api/whatsapp-chatgpt-go

This will also install the required dependencies:

  • github.com/green-api/whatsapp-chatbot-golang
  • github.com/sashabaranov/go-openai

Quick Start

package main

import (
    "log"
    "os"
    "os/signal"
    "syscall"

    "github.com/green-api/whatsapp-chatgpt-go"
)

func main() {
    // Initialize the bot
    bot := whatsapp_chatgpt_go.NewWhatsappGptBot(whatsapp_chatgpt_go.GPTBotConfig{
        IDInstance:       "your-instance-id",
        APITokenInstance: "your-token",
        OpenAIApiKey:     "your-openai-api-key",
        Model:            whatsapp_chatgpt_go.ModelGPT4o,
        SystemMessage:    "You are a helpful assistant.",
    })

    // Set up signal handling for graceful shutdown
    sigChan := make(chan os.Signal, 1)
    signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)

    // Start the bot in a goroutine
    go func() {
        log.Println("Starting WhatsApp GPT bot...")
        bot.StartReceivingNotifications()
    }()

    // Wait for termination signal
    <-sigChan

    // Shutdown
    log.Println("Shutting down bot...")
    bot.StopReceivingNotifications()
    log.Println("Bot stopped.")
}

Usage Patterns

This library supports two distinct usage patterns depending on your needs:

1. Standalone Bot

You can run the bot as a standalone service that listens for and processes WhatsApp messages automatically:

bot := whatsapp_chatgpt_go.NewWhatsappGptBot(whatsapp_chatgpt_go.GPTBotConfig{
    IDInstance:       "your-instance-id",
    APITokenInstance: "your-token",
    OpenAIApiKey:     "your-openai-api-key",
    Model:            whatsapp_chatgpt_go.ModelGPT4o,
    SystemMessage:    "You are a helpful assistant.",
})

// Start listening for webhooks and processing messages
bot.StartReceivingNotifications()
2. Message Processor

Alternatively, you can use the bot as a message processing utility within your own application:

gptBot := whatsapp_chatgpt_go.NewWhatsappGptBot(whatsapp_chatgpt_go.GPTBotConfig{
    IDInstance:       "your-instance-id",
    APITokenInstance: "your-token",
    OpenAIApiKey:     "your-openai-api-key",
    Model:            whatsapp_chatgpt_go.ModelGPT4o,
    SystemMessage:    "You are a helpful assistant.",
})

// No need to call StartReceivingNotifications - just use ProcessMessage when needed
response, updatedSessionData, err := gptBot.ProcessMessage(
    ctx, 
    notification,  // The notification from your own webhook handling
    sessionData    // Your own session data
)
if err != nil {
    // Handle error
}

// Handle the response in your own way
// Store the updated session data in your own state system

Core Components

Bot Configuration

Complete configuration options for the WhatsappGptBot:

type GPTBotConfig struct {
    // OpenAI API key
    OpenAIApiKey string
    
    // Model to use (default: gpt-4o)
    Model OpenAIModel
    
    // Maximum number of messages to keep in history (default: 10)
    MaxHistoryLength int
    
    // System message to set the bot's personality
    SystemMessage string
    
    // Temperature for response generation (default: 0.5)
    Temperature float32
    
    // Error message to show when something goes wrong
    ErrorMessage string
    
    // ID Instance from GREEN-API
    IDInstance string
    
    // API Token Instance from GREEN-API
    APITokenInstance string
    
    // Whether to clear webhook queue on start
    ClearWebhookQueueOnStart bool
}
WhatsappGptBot

Main struct for creating and managing your OpenAI-powered WhatsApp bot:

bot := whatsapp_chatgpt_go.NewWhatsappGptBot(whatsapp_chatgpt_go.GPTBotConfig{
    // Required parameters
    IDInstance:       "your-instance-id",
    APITokenInstance: "your-token",
    OpenAIApiKey:     "your-openai-api-key",

    // Optional GPT-specific parameters
    Model:            whatsapp_chatgpt_go.ModelGPT4o,
    MaxHistoryLength: 15,
    SystemMessage:    "You are a helpful assistant specializing in customer support.",
    Temperature:      0.7,
    ErrorMessage:     "Sorry, I couldn't process your request. Please try again.",
    
    // Optional behavior parameters
    ClearWebhookQueueOnStart: true,
})

Message Handling

The bot automatically handles different types of WhatsApp messages and converts them into a format understood by OpenAI's models.

Supported Message Types
  • Text
  • Image
  • Audio
  • Video
  • Document
  • Poll
  • Location
  • Contact
Message Handler Registry

The bot uses a registry of message handlers to process different message types:

// Create a custom message handler
type CustomMessageHandler struct{}

func (h *CustomMessageHandler) CanHandle(notification *whatsapp_chatbot_golang.Notification) bool {
    // Logic to determine if this handler can process the message
    return true
}

func (h *CustomMessageHandler) ProcessMessage(
    notification *whatsapp_chatbot_golang.Notification,
    client *openai.Client,
    model whatsapp_chatgpt_go.OpenAIModel,
) (interface{}, error) {
    // Process the message
    return "Processed content", nil
}

// Register the custom handler
bot.RegisterMessageHandler(&CustomMessageHandler{})

Middleware System

The middleware system allows for customizing message processing before sending to GPT and response processing before sending back to the user.

Adding Message Middleware
// Process messages before sending to GPT
bot.AddMessageMiddleware(func(
    notification *whatsapp_chatbot_golang.Notification,
    messageContent interface{},
    messages []openai.ChatCompletionMessage,
    sessionData *whatsapp_chatgpt_go.GPTSessionData,
) (interface{}, []openai.ChatCompletionMessage, error) {
    // Add custom context or modify the message
    sender, _ := notification.Sender()
    log.Printf("Processing message from %s: %v", sender, messageContent)
    
    return messageContent, messages, nil
})
Adding Response Middleware
// Process GPT responses before sending to user
bot.AddResponseMiddleware(func(
    response string,
    messages []openai.ChatCompletionMessage,
    sessionData *whatsapp_chatgpt_go.GPTSessionData,
) (string, []openai.ChatCompletionMessage, error) {
    // Format or modify the response
    formattedResponse := response + "\n\n_Powered by GREEN-API_"
    
    return formattedResponse, messages, nil
})

Session Data

The GPT bot extends the base session data with conversation-specific information:

type GPTSessionData struct {
    // Messages in the conversation
    Messages []openai.ChatCompletionMessage `json:"messages"`
    
    // Timestamp of last activity
    LastActivity int64 `json:"lastActivity"`
    
    // Custom user data
    UserData map[string]interface{} `json:"userData,omitempty"`
    
    // Context for the current conversation
    Context map[string]interface{} `json:"context,omitempty"`
}

You can access and modify this data in your middleware or through the available methods.

Supported OpenAI Models

The library supports a variety of OpenAI models:

GPT-4 Models
  • ModelGPT4 ("gpt-4")
  • ModelGPT4Turbo ("gpt-4-turbo")
  • ModelGPT4TurboPreview ("gpt-4-turbo-preview")
  • ModelGPT41106Preview ("gpt-4-1106-preview")
  • ModelGPT40125Preview ("gpt-4-0125-preview")
  • ModelGPT432k ("gpt-4-32k")
GPT-4o Models
  • ModelGPT4o ("gpt-4o") - default
  • ModelGPT4oMini ("gpt-4o-mini")
GPT-3.5 Models
  • ModelGPT35Turbo ("gpt-3.5-turbo")
  • ModelGPT35Turbo16k ("gpt-3.5-turbo-16k")
  • ModelGPT35Turbo1106 ("gpt-3.5-turbo-1106")
  • ModelGPT35Turbo0125 ("gpt-3.5-turbo-0125")
o1 Models
  • ModelO1 ("o1")
  • ModelO1Mini ("o1-mini")
  • ModelO1Preview ("o1-preview")
Image-Capable Models

The following models can process images:

  • ModelGPT4o ("gpt-4o")
  • ModelGPT4oMini ("gpt-4o-mini")
  • ModelGPT4Turbo ("gpt-4-turbo")

You can check if a model supports images using:

if whatsapp_chatgpt_go.SupportsImages(bot.GetModel()) {
    // Handle image-based workflow
}

Complete Bot Example with Middleware

package main

import (
	"fmt"
	"log"
	"os"
	"os/signal"
	"syscall"

	"github.com/green-api/whatsapp-chatbot-golang"
	"github.com/green-api/whatsapp-chatgpt-go"
	"github.com/joho/godotenv"
	"github.com/sashabaranov/go-openai"
)

func truncateString(s string, length int) string {
	if len(s) > length {
		return s[:length] + "..."
	}
	return s
}

func main() {
	err := godotenv.Load()
	if err != nil {
		log.Println("Warning: Error loading .env file:", err)
	}

	idInstance := os.Getenv("GREEN_API_ID_INSTANCE")
	apiTokenInstance := os.Getenv("GREEN_API_TOKEN_INSTANCE")
	openaiToken := os.Getenv("OPENAI_API_KEY")

	if idInstance == "" || apiTokenInstance == "" || openaiToken == "" {
		log.Fatalf("Missing required environment variables: GREEN_API_ID_INSTANCE, GREEN_API_TOKEN_INSTANCE, OPENAI_API_KEY")
	}

	config := whatsapp_chatgpt_go.GPTBotConfig{
		IDInstance:               idInstance,
		APITokenInstance:         apiTokenInstance,
		OpenAIApiKey:             openaiToken,
		Model:                    whatsapp_chatgpt_go.ModelGPT4o,
		MaxHistoryLength:         10,
		SystemMessage:            "You are a helpful assistant responding via WhatsApp.",
		Temperature:              0.7,
		ErrorMessage:             "Sorry, I encountered an error processing your message.",
		ClearWebhookQueueOnStart: true,
	}

	bot := whatsapp_chatgpt_go.NewWhatsappGptBot(config)

	// Example Middleware: Logs details about incoming message processing.
	bot.AddMessageMiddleware(func(notification *whatsapp_chatbot_golang.Notification,
		messageContent interface{},
		messages []openai.ChatCompletionMessage,
		sessionData *whatsapp_chatgpt_go.GPTSessionData) (interface{}, []openai.ChatCompletionMessage, error) {

		sender, _ := notification.Sender()

		var contentLog string
		if parts, ok := messageContent.([]openai.ChatMessagePart); ok {
			contentLog = "MultiContent Parts: ["
			for i, p := range parts {
				if i > 0 {
					contentLog += ", "
				}
				contentLog += fmt.Sprintf("{Type: %s, ", p.Type)
				if p.Type == openai.ChatMessagePartTypeText {
					contentLog += fmt.Sprintf("Text: '%s'", p.Text)
				} else if p.Type == openai.ChatMessagePartTypeImageURL && p.ImageURL != nil {
					urlStr := p.ImageURL.URL
					if len(urlStr) > 50 {
						urlStr = urlStr[:47] + "..."
					}
					contentLog += fmt.Sprintf("ImageURL: %s", urlStr)
				} else {
					contentLog += "OtherPartData"
				}
				contentLog += "}"
			}
			contentLog += "]"
		} else {
			contentLog = fmt.Sprintf("Text Content: '%s'", truncateString(fmt.Sprintf("%v", messageContent), 100))
		}
		log.Printf("--> MID: Received from %s: %s", sender, contentLog)
		log.Printf("--> MID: History has %d messages before adding current.", len(messages))

		return messageContent, messages, nil
	})

	// Example Middleware: Logs the response being sent.
	bot.AddResponseMiddleware(func(response string,
		messages []openai.ChatCompletionMessage,
		sessionData *whatsapp_chatgpt_go.GPTSessionData) (string, []openai.ChatCompletionMessage, error) {

		log.Printf("<-- MID: Sending response: %s", truncateString(response, 100))
		log.Printf("<-- MID: History has %d messages after adding assistant response.", len(messages))
		return response, messages, nil
	})

	sigChan := make(chan os.Signal, 1)
	signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)

	go func() {
		log.Println("Starting WhatsApp GPT bot...")
		bot.StartReceivingNotifications()
		log.Println("Notification receiving loop stopped.")
	}()

	<-sigChan

	log.Println("Shutting down bot...")
	bot.StopReceivingNotifications()
	log.Println("Bot stopped.")
}

Available Methods

WhatsappGptBot
  • NewWhatsappGptBot(config GPTBotConfig) *WhatsappGptBot - Creates a new GPT-enabled WhatsApp bot
  • StartReceivingNotifications() - Starts receiving and processing webhook notifications
  • StopReceivingNotifications() - Stops the notification listener
  • ProcessMessage(ctx context.Context, notification *whatsapp_chatbot_golang.Notification, sessionData *GPTSessionData) (string, *GPTSessionData, error) - Processes a message without using the bot's internal state manager
  • AddMessageMiddleware(middleware ProcessMessageMiddleware) - Registers a middleware to process incoming messages
  • AddResponseMiddleware(middleware ProcessResponseMiddleware) - Registers a middleware to process GPT responses
  • RegisterMessageHandler(handler MessageHandler) - Adds a custom message handler
  • GetOpenAI() *openai.Client - Returns the OpenAI client instance
  • GetModel() OpenAIModel - Returns the configured Open AI model identifier
  • GetSystemMessage() string - Returns the configured system message
  • SupportsImages() bool - Checks if the currently configured model supports image input
  • Methods() - Access to the base library's methods for sending messages, etc.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

ImageCapableModels lists models known to support image input.

Functions

func SupportsImages

func SupportsImages(model OpenAIModel) bool

SupportsImages checks if a model supports image processing based on the known list.

Types

type AudioHandler

type AudioHandler struct{}

AudioHandler handles audio/voice messages

func (*AudioHandler) CanHandle

func (h *AudioHandler) CanHandle(notification *whatsapp_chatbot_golang.Notification) bool

CanHandle checks if the message is an audio message

func (*AudioHandler) ProcessMessage

func (h *AudioHandler) ProcessMessage(notification *whatsapp_chatbot_golang.Notification, client *openai.Client, _ OpenAIModel) (interface{}, error)

ProcessMessage processes an audio message

type ContactHandler

type ContactHandler struct{}

ContactHandler handles contact messages

func (*ContactHandler) CanHandle

func (h *ContactHandler) CanHandle(notification *whatsapp_chatbot_golang.Notification) bool

CanHandle checks if the message is a contact message

func (*ContactHandler) ProcessMessage

func (h *ContactHandler) ProcessMessage(notification *whatsapp_chatbot_golang.Notification, _ *openai.Client, _ OpenAIModel) (interface{}, error)

ProcessMessage processes a contact message

type DocumentHandler

type DocumentHandler struct{}

DocumentHandler handles document messages

func (*DocumentHandler) CanHandle

func (h *DocumentHandler) CanHandle(notification *whatsapp_chatbot_golang.Notification) bool

CanHandle checks if the message is a document message

func (*DocumentHandler) ProcessMessage

func (h *DocumentHandler) ProcessMessage(notification *whatsapp_chatbot_golang.Notification, _ *openai.Client, _ OpenAIModel) (interface{}, error)

ProcessMessage processes a document message

type FallbackHandler

type FallbackHandler struct{}

FallbackHandler handles unsupported message types

func (*FallbackHandler) CanHandle

func (h *FallbackHandler) CanHandle(_ *whatsapp_chatbot_golang.Notification) bool

CanHandle always returns true as this is the fallback handler

func (*FallbackHandler) ProcessMessage

func (h *FallbackHandler) ProcessMessage(notification *whatsapp_chatbot_golang.Notification, _ *openai.Client, _ OpenAIModel) (interface{}, error)

ProcessMessage provides a fallback message for unsupported types

type GPTBotConfig

type GPTBotConfig struct {
	// OpenAI API key
	OpenAIApiKey string
	// Model to use (default: gpt-4o)
	Model OpenAIModel
	// Maximum number of messages to keep in history
	MaxHistoryLength int
	// System message to set the bot's personality
	SystemMessage string
	// Temperature for response generation
	Temperature float32
	// Error message to show when something goes wrong
	ErrorMessage string
	// ID Instance from GREEN-API
	IDInstance string
	// API Token Instance from GREEN-API
	APITokenInstance string
	// Whether to clear webhook queue on start
	ClearWebhookQueueOnStart bool
}

GPTBotConfig contains configuration for the GPT bot

type GPTSessionData

type GPTSessionData struct {
	// Messages in the conversation
	Messages []openai.ChatCompletionMessage `json:"messages"`
	// Timestamp of last activity
	LastActivity int64 `json:"lastActivity"`
	// Custom user data
	UserData map[string]interface{} `json:"userData,omitempty"`
	// Context for the current conversation
	Context map[string]interface{} `json:"context,omitempty"`
}

GPTSessionData contains conversation history and model settings

type ImageHandler

type ImageHandler struct{}

ImageHandler handles image messages

func (*ImageHandler) CanHandle

func (h *ImageHandler) CanHandle(notification *whatsapp_chatbot_golang.Notification) bool

CanHandle checks if the message is an image message

func (*ImageHandler) ProcessMessage

func (h *ImageHandler) ProcessMessage(notification *whatsapp_chatbot_golang.Notification, _ *openai.Client, model OpenAIModel) (interface{}, error)

ProcessMessage processes an image message

type LocationHandler

type LocationHandler struct{}

LocationHandler handles location messages

func (*LocationHandler) CanHandle

func (h *LocationHandler) CanHandle(notification *whatsapp_chatbot_golang.Notification) bool

CanHandle checks if the message is a location message

func (*LocationHandler) ProcessMessage

func (h *LocationHandler) ProcessMessage(notification *whatsapp_chatbot_golang.Notification, _ *openai.Client, _ OpenAIModel) (interface{}, error)

ProcessMessage processes a location message

type MessageHandler

type MessageHandler interface {
	CanHandle(notification *whatsapp_chatbot_golang.Notification) bool
	ProcessMessage(notification *whatsapp_chatbot_golang.Notification, client *openai.Client, model OpenAIModel) (interface{}, error)
}

MessageHandler interface for processing different message types

type OpenAIModel

type OpenAIModel string

OpenAIModel represents an OpenAI model identifier

const (
	ModelGPT4             OpenAIModel = "gpt-4"
	ModelGPT4Turbo        OpenAIModel = "gpt-4-turbo"
	ModelGPT4TurboPreview OpenAIModel = "gpt-4-turbo-preview"
	ModelGPT41106Preview  OpenAIModel = "gpt-4-1106-preview"
	ModelGPT40125Preview  OpenAIModel = "gpt-4-0125-preview"
	ModelGPT432k          OpenAIModel = "gpt-4-32k"
	ModelGPT4o            OpenAIModel = "gpt-4o"
	ModelGPT4oMini        OpenAIModel = "gpt-4o-mini"
	ModelGPT35Turbo       OpenAIModel = "gpt-3.5-turbo"
	ModelGPT35Turbo16k    OpenAIModel = "gpt-3.5-turbo-16k"
	ModelGPT35Turbo1106   OpenAIModel = "gpt-3.5-turbo-1106"
	ModelGPT35Turbo0125   OpenAIModel = "gpt-3.5-turbo-0125"
	ModelO1               OpenAIModel = "o1"
	ModelO1Mini           OpenAIModel = "o1-mini"
	ModelO1Preview        OpenAIModel = "o1-preview"
	DefaultModel                      = ModelGPT4o
)

OpenAI model constants

func (OpenAIModel) String

func (m OpenAIModel) String() string

String returns the string representation of the OpenAIModel.

type PollHandler

type PollHandler struct{}

PollHandler handles incoming poll creation messages

func (*PollHandler) CanHandle

func (h *PollHandler) CanHandle(notification *whatsapp_chatbot_golang.Notification) bool

CanHandle checks if the message is a poll creation message

func (*PollHandler) ProcessMessage

func (h *PollHandler) ProcessMessage(notification *whatsapp_chatbot_golang.Notification, _ *openai.Client, _ OpenAIModel) (interface{}, error)

ProcessMessage processes a poll creation message

type PollUpdateHandler

type PollUpdateHandler struct{}

PollUpdateHandler handles incoming poll update messages

func (*PollUpdateHandler) CanHandle

func (h *PollUpdateHandler) CanHandle(notification *whatsapp_chatbot_golang.Notification) bool

CanHandle checks if the message is a poll update message

func (*PollUpdateHandler) ProcessMessage

func (h *PollUpdateHandler) ProcessMessage(notification *whatsapp_chatbot_golang.Notification, _ *openai.Client, _ OpenAIModel) (interface{}, error)

ProcessMessage processes a poll update message

type ProcessMessageMiddleware

type ProcessMessageMiddleware func(notification *whatsapp_chatbot_golang.Notification, messageContent interface{}, messages []openai.ChatCompletionMessage, sessionData *GPTSessionData) (interface{}, []openai.ChatCompletionMessage, error)

ProcessMessageMiddleware processes a message before sending to GPT

type ProcessResponseMiddleware

type ProcessResponseMiddleware func(response string, messages []openai.ChatCompletionMessage, sessionData *GPTSessionData) (string, []openai.ChatCompletionMessage, error)

ProcessResponseMiddleware processes a response before sending to the user

type TextHandler

type TextHandler struct{}

TextHandler handles text messages

func (*TextHandler) CanHandle

func (h *TextHandler) CanHandle(notification *whatsapp_chatbot_golang.Notification) bool

CanHandle checks if the message is a text message

func (*TextHandler) ProcessMessage

func (h *TextHandler) ProcessMessage(notification *whatsapp_chatbot_golang.Notification, _ *openai.Client, _ OpenAIModel) (interface{}, error)

ProcessMessage processes a text message

type VideoHandler

type VideoHandler struct{}

VideoHandler handles video messages

func (*VideoHandler) CanHandle

func (h *VideoHandler) CanHandle(notification *whatsapp_chatbot_golang.Notification) bool

CanHandle checks if the message is a video message

func (*VideoHandler) ProcessMessage

func (h *VideoHandler) ProcessMessage(notification *whatsapp_chatbot_golang.Notification, _ *openai.Client, _ OpenAIModel) (interface{}, error)

ProcessMessage processes a video message

type WhatsappGptBot

type WhatsappGptBot struct {
	*whatsapp_chatbot_golang.Bot
	// contains filtered or unexported fields
}

WhatsappGptBot extends the base WhatsApp bot with GPT capabilities

func NewWhatsappGptBot

func NewWhatsappGptBot(config GPTBotConfig) *WhatsappGptBot

NewWhatsappGptBot creates a new GPT-enabled WhatsApp bot

func (*WhatsappGptBot) AddMessageMiddleware

func (bot *WhatsappGptBot) AddMessageMiddleware(middleware ProcessMessageMiddleware)

AddMessageMiddleware registers a middleware to process incoming messages before GPT.

func (*WhatsappGptBot) AddResponseMiddleware

func (bot *WhatsappGptBot) AddResponseMiddleware(middleware ProcessResponseMiddleware)

AddResponseMiddleware registers a middleware to process GPT responses before sending.

func (*WhatsappGptBot) GetModel

func (bot *WhatsappGptBot) GetModel() OpenAIModel

GetModel returns the configured OpenAI model identifier.

func (*WhatsappGptBot) GetOpenAI

func (bot *WhatsappGptBot) GetOpenAI() *openai.Client

GetOpenAI returns the OpenAI client instance for potential custom use.

func (*WhatsappGptBot) GetSystemMessage

func (bot *WhatsappGptBot) GetSystemMessage() string

GetSystemMessage returns the configured system message for the bot.

func (*WhatsappGptBot) ProcessMessage

func (bot *WhatsappGptBot) ProcessMessage(ctx context.Context, notification *whatsapp_chatbot_golang.Notification, sessionData *GPTSessionData) (string, *GPTSessionData, error)

ProcessMessage allows processing a message without using the bot's internal state manager.

func (*WhatsappGptBot) RegisterMessageHandler

func (bot *WhatsappGptBot) RegisterMessageHandler(handler MessageHandler)

RegisterMessageHandler adds a custom message handler.

func (*WhatsappGptBot) SupportsImages

func (bot *WhatsappGptBot) SupportsImages() bool

SupportsImages checks if the currently configured model supports image input.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL