Documentation
¶
Index ¶
- Constants
- func GenerateAd(ad *Ad, adType string, jsFunc string) (string, error)
- func GetChatAd(apiId string, apiKey string, userID string, conversationID string, ...) (string, error)
- func GetPageAd(apiId string, apiKey string, pageContent string, adType string, jsFunc string) (string, error)
- func PostAPIRequest(relativeURL string, payload interface{}) (interface{}, error)
- func SendChatHistory(apiId string, apiKey string, userID string, conversationID string, ...) error
- type Ad
- type ChatMessage
- type GetChatAdRequest
- type GetPageAdRequest
- type SendChatHistoryRequest
- type ServiceResult
Constants ¶
View Source
const ( AdTypeText = "text" AdTypeImage = "image" AdTypeBannerMediumRect = "Medium Rectangle Banner" AdTypeBannerLeaderboard = "Leaderboard Banner" AdTypeBannerWideSky = "Wide Skyscraper Banner" )
View Source
const ( ChatMessageRoleUser = "User" ChatMessageRoleBot = "Bot" )
View Source
const ( AdTypeJsonText = "JsonText" AdTypeJsonImage = "JsonImage" AdTypeHtmlText = "HtmlTextAd" AdTypeHtmlImage = "HtmlImageAd" AdTypeJavaScriptText = "AdTypeJavaScriptText" AdTypeJavaScriptImage = "AdTypeJavaScriptImage" AdTypeBannerMediumRectJson = "AdTypeBannerMediumRectJson" AdTypeBannerLeaderboardJson = "AdTypeBannerLeaderboardJson" AdTypeBannerWideSkyJson = "AdTypeBannerWideSkyJson" AdTypeBannerMediumRectHtml = "AdTypeBannerMediumRectHtml" AdTypeBannerLeaderboardHtml = "AdTypeBannerLeaderboardHtml" AdTypeBannerWideSkyHtml = "AdTypeBannerWideSkyHtml" )
View Source
const APIBaseURL = "http://147.93.43.199"
Variables ¶
This section is empty.
Functions ¶
func PostAPIRequest ¶
func SendChatHistory ¶
Types ¶
type Ad ¶
type Ad struct {
ID int `json:"id"`
URL string `json:"url"`
Title string `json:"title"`
Description string `json:"description"`
ImageURL string `json:"imageUrl"`
}
Ad represents an advertisement with basic properties.
type ChatMessage ¶
type GetChatAdRequest ¶
type GetPageAdRequest ¶
type GetPageAdRequest struct {
ApiID string `json:"apiId"`
ApiKey string `json:"apiKey"`
Type string `json:"type"`
PageContents string `json:"pageContents"` // Page HTML or plain text contents
}
GetPageAdRequest represents a request to get an ad for a page.
type SendChatHistoryRequest ¶
type SendChatHistoryRequest struct {
ApiID string `json:"apiId"`
ApiKey string `json:"apiKey"`
UserID string `json:"userID"`
ConversationID string `json:"conversationID"`
Messages []ChatMessage `json:"messages"`
}
type ServiceResult ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.