Documentation
¶
Overview ¶
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Index ¶
- Constants
- type ChatRequest
- type ChatResponse
- type Choice
- type Client
- func (c *Client) BibIdFormat(b *documents.Bibliography) (string, error)
- func (c *Client) ChatCompletion(req ChatRequest, baseURL string) (*ChatResponse, error)
- func (c *Client) Classify(text string) (string, error)
- func (c *Client) EntryFromBibliography(b *documents.Bibliography, i int) (string, error)
- func (c *Client) EntryFromRaw(b64 string, i int) (string, error)
- func (c *Client) ExtractBib(b *documents.Bibliography) ([]Entry, error)
- func (c *Client) ExtractDocumentMetadata(encoded string) (*documents.Metadata, error)
- func (c *Client) HTMLMetadata(html []byte) (*documents.Metadata, error)
- func (c *Client) NumBibliographyEntries(b *documents.Bibliography) (int, error)
- func (c *Client) NumEntries(b64 string) (int, error)
- func (c *Client) PDFMetadata(raw []byte) (*documents.Metadata, error)
- func (c *Client) ParseAuthors(text string) (*entries.Authors, error)
- func (c *Client) ParseOnline(text string) (*entries.Online, error)
- func (c *Client) ParsePub(text string) (string, error)
- func (c *Client) ParseSoftware(text string) (*entries.Software, error)
- func (c *Client) ParseTitle(text string) (string, error)
- func (c *Client) ParseURL(text string) (string, error)
- func (c *Client) PrepareBibliography(filePath string) (*documents.Bibliography, error)
- func (c *Client) PrepareBibliographyContent(pdf []byte) (*documents.Bibliography, error)
- func (c *Client) SearchEntry(text string) (bool, string, error)
- func (c *Client) SearchOnline(website *entries.Online) (bool, string, error)
- func (c *Client) SearchSoftware(software *entries.Software) (bool, string, error)
- func (c *Client) Summarize(lr *lookup.Result) (bool, string, error)
- type Entry
- type File
- type FileContent
- type Message
- type Opt
- type PDFEngine
- type PDFPlugin
- type Plugin
- type Provider
- type Reasoning
- type ResponseFormat
- func NewBibEntryTextResponseFormat() *ResponseFormat
- func NewBibIDFormatResponseFormat() *ResponseFormat
- func NewBibliographyPageResponseFormat() *ResponseFormat
- func NewClassifyEntryResponseFormat() *ResponseFormat
- func NewExtractBibResponseFormat() *ResponseFormat
- func NewExtractDocumentMetadataRF() *ResponseFormat
- func NewNumEntriesResponseFormat() *ResponseFormat
- func NewParseAuthorsRF() *ResponseFormat
- func NewParseOnlineRF() *ResponseFormat
- func NewParsePubRF() *ResponseFormat
- func NewParseSoftwareRF() *ResponseFormat
- func NewParseTitleRF() *ResponseFormat
- func NewParseURLRF() *ResponseFormat
- type TextContent
Constants ¶
const ( BibIdFormatUnknown string = bibliography.BibIDFormatUnknown BibIdFormatNumeric string = bibliography.BibIDFormatNumeric BibIdFormatAlphanumeric string = bibliography.BibIDFormatAlphanumeric )
const ( ModelLlama3170BInstruct string = "meta-llama/llama-3.1-70b-instruct" ModelGemini25Flash string = "google/gemini-2.5-flash" ProviderAmazonBedrock string = "amazon-bedrock" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRequest ¶
type ChatRequest struct {
Model string `json:"model"`
Messages []Message `json:"messages"`
Plugins []Plugin `json:"plugins,omitempty"`
ResponseFormat *ResponseFormat `json:"response_format,omitempty"`
Provider Provider `json:"provider,omitempty"`
Temperature *int `json:"temperature,omitempty"`
Reasoning *Reasoning `json:"reasoning,omitempty"`
}
ChatRequest represents the request payload
type ChatResponse ¶
ChatResponse represents the API response
type Choice ¶
type Choice struct {
Message Message `json:"message"`
}
Choice represents a response choice
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an OpenRouter API client
func (*Client) BibIdFormat ¶ added in v0.3.0
func (c *Client) BibIdFormat(b *documents.Bibliography) (string, error)
func (*Client) ChatCompletion ¶
func (c *Client) ChatCompletion(req ChatRequest, baseURL string) (*ChatResponse, error)
ChatCompletion sends a chat completion request
func (*Client) EntryFromBibliography ¶ added in v0.3.0
func (*Client) ExtractBib ¶ added in v0.3.0
func (c *Client) ExtractBib(b *documents.Bibliography) ([]Entry, error)
func (*Client) ExtractDocumentMetadata ¶
func (*Client) HTMLMetadata ¶
func (*Client) NumBibliographyEntries ¶ added in v0.3.0
func (c *Client) NumBibliographyEntries(b *documents.Bibliography) (int, error)
func (*Client) ParseAuthors ¶ added in v0.2.0
func (*Client) ParseOnline ¶ added in v0.2.0
func (*Client) ParsePub ¶ added in v0.2.0
ParsePub returns the title of a journal or a book from a bibliography entry
func (*Client) ParseSoftware ¶
func (*Client) ParseTitle ¶ added in v0.2.0
func (*Client) PrepareBibliography ¶ added in v0.3.0
func (c *Client) PrepareBibliography(filePath string) (*documents.Bibliography, error)
func (*Client) PrepareBibliographyContent ¶ added in v0.3.0
func (c *Client) PrepareBibliographyContent(pdf []byte) (*documents.Bibliography, error)
func (*Client) SearchOnline ¶ added in v0.2.0
func (*Client) SearchSoftware ¶
type FileContent ¶
func MakeFileContent ¶
func MakeFileContent(b64 string) FileContent
type PDFPlugin ¶ added in v0.3.0
type PDFPlugin struct {
Engine PDFEngine `json:"engine,omitempty"`
}
type Plugin ¶ added in v0.3.0
func FileParserPlugin ¶ added in v0.3.0
func PDFParserPlugins ¶ added in v0.3.0
type Provider ¶
type Provider struct {
RequireParameters bool `json:"require_parameters"`
Sort string `json:"sort,omitempty"`
Only []string `json:"only,omitempty"`
}
Provider represents provider configuration
type ResponseFormat ¶
type ResponseFormat struct {
Type string `json:"type"`
JSONSchema map[string]interface{} `json:"json_schema"`
}
ResponseFormat represents the expected response format
func NewBibEntryTextResponseFormat ¶
func NewBibEntryTextResponseFormat() *ResponseFormat
func NewBibIDFormatResponseFormat ¶ added in v0.3.0
func NewBibIDFormatResponseFormat() *ResponseFormat
func NewBibliographyPageResponseFormat ¶ added in v0.3.0
func NewBibliographyPageResponseFormat() *ResponseFormat
func NewClassifyEntryResponseFormat ¶
func NewClassifyEntryResponseFormat() *ResponseFormat
func NewExtractBibResponseFormat ¶ added in v0.3.0
func NewExtractBibResponseFormat() *ResponseFormat
func NewExtractDocumentMetadataRF ¶
func NewExtractDocumentMetadataRF() *ResponseFormat
func NewNumEntriesResponseFormat ¶
func NewNumEntriesResponseFormat() *ResponseFormat
func NewParseAuthorsRF ¶ added in v0.3.0
func NewParseAuthorsRF() *ResponseFormat
func NewParseOnlineRF ¶ added in v0.2.0
func NewParseOnlineRF() *ResponseFormat
func NewParsePubRF ¶ added in v0.3.0
func NewParsePubRF() *ResponseFormat
func NewParseSoftwareRF ¶
func NewParseSoftwareRF() *ResponseFormat
func NewParseTitleRF ¶ added in v0.3.0
func NewParseTitleRF() *ResponseFormat
func NewParseURLRF ¶
func NewParseURLRF() *ResponseFormat
type TextContent ¶
func MakeTextContent ¶
func MakeTextContent(text string) TextContent