Documentation
¶
Overview ¶
httpclient implements an API client for DeepSeek's web search and fetch https://api-docs.deepseek.com/guides/search/
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func New ¶
New returns a client for DeepSeek's web search and fetch with the API key, which is the same key as its models'. The endpoint can be replaced with client.OptEndpoint, for example for testing.
func (*Client) Fetch ¶
func (c *Client) Fetch(ctx context.Context, req *FetchRequest) (FetchResponse, error)
Fetch returns the title, and the content as Markdown, of the web page with the URL in the request
func (*Client) Search ¶
func (c *Client) Search(ctx context.Context, req *SearchRequest) (SearchResponse, error)
Search returns the results of searching the web for the query in the request
type FetchRequest ¶
type FetchRequest struct {
URL string `json:"url" help:"URL of the web page to fetch"`
}
FetchRequest is a request to fetch a web page
type FetchResponse ¶
FetchResponse is a fetched web page, whose content is Markdown
func (FetchResponse) String ¶
func (r FetchResponse) String() string
type SearchRequest ¶
type SearchRequest struct {
Query string `` /* 189-byte string literal not displayed */
Count int `json:"count,omitempty" help:"Maximum number of results to return (1-10)" min:"1" max:"10" default:"3"`
Question *string `` /* 158-byte string literal not displayed */
}
SearchRequest is a request to search the web
type SearchResponse ¶
type SearchResponse struct {
Results []SearchResult `json:"results"`
}
SearchResponse is the results of searching the web
func (SearchResponse) String ¶
func (r SearchResponse) String() string
type SearchResult ¶
type SearchResult struct {
Title string `json:"title"`
URL string `json:"url"`
SiteName *string `json:"site_name,omitempty"`
Date *time.Time `json:"date,omitempty"`
Summary string `json:"summary"`
}
SearchResult is a web page which matched the search query, with a summary of it for models, and when it was published, when that's known