Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) EnrichmentCompletion(endpointType string, params EnrichmentParams) (res EnrichmentResponse, err error)
- func (c *Client) FastGPTCompletion(params FastGPTCompletionParams) (res FastGPTCompletionResponse, err error)
- func (c *Client) GetAPIKey() string
- func (c *Client) GetAPIVersion() constants.ApiVersion
- func (c *Client) SendRequest(method, path string, data interface{}, v any) (err error)
- func (c *Client) SetAPIKey(apiKey string)
- func (c *Client) SetAPIVersion(apiVersion constants.ApiVersion)
- func (c *Client) UniversalSummarizerCompletion(params UniversalSummarizerParams) (res UniversalSummarizerResponse, err error)
- type ClientConfig
- type EnrichmentParams
- type EnrichmentResponse
- type FastGPTCompletionParams
- type FastGPTCompletionResponse
- type SummaryEngine
- type SummaryType
- type UniversalSummarizerParams
- type UniversalSummarizerResponse
Constants ¶
View Source
const ( EndpointTypeWeb string = "web" EndpointTypeNews string = "news" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Config *ClientConfig
}
func NewClient ¶
func NewClient(config *ClientConfig) *Client
func (*Client) EnrichmentCompletion ¶ added in v0.0.6
func (c *Client) EnrichmentCompletion(endpointType string, params EnrichmentParams) (res EnrichmentResponse, err error)
func (*Client) FastGPTCompletion ¶
func (c *Client) FastGPTCompletion(params FastGPTCompletionParams) (res FastGPTCompletionResponse, err error)
func (*Client) GetAPIVersion ¶
func (c *Client) GetAPIVersion() constants.ApiVersion
func (*Client) SendRequest ¶
func (*Client) SetAPIVersion ¶
func (c *Client) SetAPIVersion(apiVersion constants.ApiVersion)
func (*Client) UniversalSummarizerCompletion ¶ added in v0.0.2
func (c *Client) UniversalSummarizerCompletion(params UniversalSummarizerParams) (res UniversalSummarizerResponse, err error)
type ClientConfig ¶
type ClientConfig struct { APIKey string APIVersion constants.ApiVersion }
type EnrichmentParams ¶ added in v0.0.6
type EnrichmentParams struct {
Q string `json:"q"`
}
type EnrichmentResponse ¶ added in v0.0.6
type EnrichmentResponse struct { Meta struct { ID string `json:"id"` Node string `json:"node"` Ms int `json:"ms"` API float64 `json:"api_balance"` } `json:"meta"` Data []struct { T int `json:"t"` Rank int `json:"rank"` URL string `json:"url"` Title string `json:"title"` Snippet string `json:"snippet"` Published string `json:"published"` List []string `json:"list"` } `json:"data"` Errors []types.Error `json:"error"` }
type FastGPTCompletionParams ¶
type FastGPTCompletionResponse ¶
type FastGPTCompletionResponse struct { Meta struct { ID string `json:"id"` Node string `json:"node"` Ms int `json:"ms"` APIBalance float64 `json:"api_balance"` } `json:"meta"` Data struct { Output string `json:"output"` Tokens int `json:"tokens"` References []struct { Title string `json:"title"` Snippet string `json:"snippet"` URL string `json:"url"` } `json:"references"` } `json:"data"` Errors []types.Error `json:"error"` }
type SummaryEngine ¶ added in v0.0.2
type SummaryEngine string
const ( SummaryEngineCecil SummaryEngine = "cecil" SummaryEngineAgnes SummaryEngine = "agnes" SummaryEngineDaphne SummaryEngine = "daphne" SummaryEngineMuriel SummaryEngine = "muriel" )
type SummaryType ¶ added in v0.0.2
type SummaryType string
const ( SummaryTypeSummary SummaryType = "summary" SummaryTypeTakeaways SummaryType = "takeaway" )
type UniversalSummarizerParams ¶ added in v0.0.2
type UniversalSummarizerParams struct { URL string `json:"url"` SummaryType SummaryType `json:"summary_type"` Engine SummaryEngine `json:"engine"` }
type UniversalSummarizerResponse ¶ added in v0.0.2
Click to show internal directories.
Click to hide internal directories.