google

package
v1.0.45 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB) error

Types

type Author

type Author struct {
	DisplayName string `json:"displayName"`
	Uri         string `json:"uri"`
	PhotoUri    string `json:"photoUri"`
}

type FCMMessage

type FCMMessage struct {
	To   string            `json:"to"`
	Data map[string]string `json:"data"`
}

type FCMService

type FCMService struct {
	// contains filtered or unexported fields
}

func NewFCMService

func NewFCMService(ctx *context.ERPContext, serverKey, credentialPath *string) *FCMService

func NewFCMServiceV2

func NewFCMServiceV2(ctx *golangCtx.Context, credentialPath *string) *FCMService

func (*FCMService) SendFCMMessage

func (s *FCMService) SendFCMMessage(token, title, body string) error

func (*FCMService) SendFCMV2Message

func (s *FCMService) SendFCMV2Message(token, title, body string, data map[string]string) error

func (*FCMService) SendFCMV2MessageByUserID

func (s *FCMService) SendFCMV2MessageByUserID(userID, title, body string, data map[string]string) error

type GeminiService

type GeminiService struct {
	// contains filtered or unexported fields
}

func NewGeminiService

func NewGeminiService(ctx *erpContext.ERPContext, apiKey string) *GeminiService

func (*GeminiService) AddHistory

func (s *GeminiService) AddHistory(history models.GeminiHistoryModel) error

func (*GeminiService) CreateAgent

func (s *GeminiService) CreateAgent(agent *models.GeminiAgent) error

func (*GeminiService) DeleteAgent

func (s *GeminiService) DeleteAgent(id string) error

func (*GeminiService) DeleteHistory

func (s *GeminiService) DeleteHistory(id string) error

func (*GeminiService) GenerateContent

func (service *GeminiService) GenerateContent(ctx context.Context, input string, userHistories []map[string]any, fileURL, mimeType string) (string, error)

func (*GeminiService) GetAgent

func (s *GeminiService) GetAgent(id string) (*models.GeminiAgent, error)

func (*GeminiService) GetAgents

func (s *GeminiService) GetAgents(request http.Request) (paginate.Page, error)

func (*GeminiService) GetHistories

func (s *GeminiService) GetHistories(agentID *string, companyID *string) []models.GeminiHistoryModel

func (*GeminiService) RefreshHistories

func (s *GeminiService) RefreshHistories()

func (*GeminiService) SetResponseMIMEType

func (s *GeminiService) SetResponseMIMEType(mimetype string)

func (*GeminiService) SetUpSystemInstruction

func (service *GeminiService) SetUpSystemInstruction(systemInstruction string)

func (*GeminiService) SetupAPIKey

func (s *GeminiService) SetupAPIKey(apiKey string, skipHistory bool)

func (*GeminiService) SetupAgentID

func (s *GeminiService) SetupAgentID(agentID string)

func (*GeminiService) SetupModel

func (service *GeminiService) SetupModel(
	setTemperature float32,
	setTopK int32,
	setTopP float32,
	setMaxOutputTokens int32,
	responseMimetype string,
	model string,
)

func (*GeminiService) SetupSessionCode

func (s *GeminiService) SetupSessionCode(sessionCode string)

func (*GeminiService) UpdateAgent

func (s *GeminiService) UpdateAgent(id string, agent *models.GeminiAgent) error

func (*GeminiService) UpdateHistory

func (s *GeminiService) UpdateHistory(id string, history models.GeminiHistoryModel) error

func (*GeminiService) UploadToGemini

func (s *GeminiService) UploadToGemini(path, mimeType string) (string, error)

type GoogleAPIService

type GoogleAPIService struct {
	// contains filtered or unexported fields
}

func NewGoogleAPIService

func NewGoogleAPIService(ctx *context.ERPContext, apiKey string) *GoogleAPIService

func (*GoogleAPIService) SearchPlace

func (s *GoogleAPIService) SearchPlace(keyword string) (*PlacesResponse, error)

func (*GoogleAPIService) SearchPlaceByCoordinate

func (s *GoogleAPIService) SearchPlaceByCoordinate(latitude float64, longitude float64, maxResult int, radius float64) (*PlacesResponse, error)

func (*GoogleAPIService) SetPlacePhoto

func (s *GoogleAPIService) SetPlacePhoto(placePhoto bool)

type Location

type Location struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type Photo

type Photo struct {
	Name               string   `json:"name"`
	WidthPx            int      `json:"widthPx"`
	HeightPx           int      `json:"heightPx"`
	AuthorAttributions []Author `json:"authorAttributions"`
	FlagContentUri     string   `json:"flagContentUri"`
	GoogleMapsUri      string   `json:"googleMapsUri"`
}

type Place

type Place struct {
	ID                       string   `json:"id"`
	FormattedAddress         string   `json:"formattedAddress"`
	InternationalPhoneNumber string   `json:"internationalPhoneNumber"`
	Location                 Location `json:"location"`
	DisplayName              struct {
		Text string `json:"text"`
	} `json:"displayName"`
	Photos   []Photo `json:"photos"`
	PhotoURL string  `json:"photoUrl"`
}

type PlacesResponse

type PlacesResponse struct {
	Places []Place `json:"places"`
}

Jump to

Keyboard shortcuts

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