Documentation
¶
Index ¶
- type ASR
- type ASRParams
- type ASRWord
- type AdGeneration
- type AdGenerationParams
- type Arc
- type Async
- type AsyncResult
- type AsyncResultParams
- type BatchClassification
- type BatchClassificationParams
- type BatchGeneration
- type BatchGenerationParams
- type BatchSummarization
- type BatchSummarizationParams
- type BatchTranslation
- type BatchTranslationParams
- type Chatbot
- type ChatbotParams
- type Classification
- type ClassificationParams
- type Client
- func (c *Client) ASR(params ASRParams, opts ...Option) (*ASR, error)
- func (c *Client) AdGeneration(params AdGenerationParams, opts ...Option) (*AdGeneration, error)
- func (c *Client) AsyncResult(params AsyncResultParams, opts ...Option) (*AsyncResult, error)
- func (c *Client) BatchClassification(params BatchClassificationParams, opts ...Option) (*BatchClassification, error)
- func (c *Client) BatchGeneration(params BatchGenerationParams) (*BatchGeneration, error)
- func (c *Client) BatchSummarization(params BatchSummarizationParams, opts ...Option) (*BatchSummarization, error)
- func (c *Client) BatchTranslation(params BatchTranslationParams, opts ...Option) (*BatchTranslation, error)
- func (c *Client) Chatbot(params ChatbotParams, opts ...Option) (*Chatbot, error)
- func (c *Client) Classification(params ClassificationParams, opts ...Option) (*Classification, error)
- func (c *Client) CodeGeneration(params CodeGenerationParams, opts ...Option) (*CodeGeneration, error)
- func (c *Client) Dependencies(params DependenciesParams, opts ...Option) (*Dependencies, error)
- func (c *Client) Embeddings(params EmbeddingsParams, opts ...Option) (*Embeddings, error)
- func (c *Client) Entities(params EntitiesParams, opts ...Option) (*Entities, error)
- func (c *Client) GSCorrection(params GSCorrectionParams, opts ...Option) (*GSCorrection, error)
- func (c *Client) Generation(params GenerationParams, opts ...Option) (*Generation, error)
- func (c *Client) ImageGeneration(params ImageGenerationParams, opts ...Option) (*ImageGeneration, error)
- func (c *Client) IntentClassification(params IntentClassificationParams, opts ...Option) (*IntentClassification, error)
- func (c *Client) KwKpExtraction(params KwKpExtractionParams, opts ...Option) (*KwKpExtraction, error)
- func (c *Client) LangDetection(params LangDetectionParams, opts ...Option) (*LangDetection, error)
- func (c *Client) Paraphrasing(params ParaphrasingParams, opts ...Option) (*Paraphrasing, error)
- func (c *Client) Question(params QuestionParams, opts ...Option) (*Question, error)
- func (c *Client) SemanticSearch(params SemanticSearchParams, opts ...Option) (*SemanticSearch, error)
- func (c *Client) SemanticSimilarity(params SemanticSimilarityParams, opts ...Option) (*SemanticSimilarity, error)
- func (c *Client) SentenceDependencies(params SentenceDependenciesParams, opts ...Option) (*SentenceDependencies, error)
- func (c *Client) Sentiment(params SentimentParams, opts ...Option) (*Sentiment, error)
- func (c *Client) SpeechSynthesis(params SpeechSynthesisParams, opts ...Option) (*SpeechSynthesis, error)
- func (c *Client) StreamingChatbot(params ChatbotParams, opts ...Option) (io.ReadCloser, error)
- func (c *Client) StreamingGeneration(params GenerationParams, opts ...Option) (io.ReadCloser, error)
- func (c *Client) Summarization(params SummarizationParams, opts ...Option) (*Summarization, error)
- func (c *Client) Tokens(params TokensParams, opts ...Option) (*Tokens, error)
- func (c *Client) Translation(params TranslationParams, opts ...Option) (*Translation, error)
- type ClientParams
- type CodeGeneration
- type CodeGenerationParams
- type Dependencies
- type DependenciesParams
- type Embeddings
- type EmbeddingsParams
- type Entities
- type EntitiesParams
- type Entity
- type Exchange
- type GSCorrection
- type GSCorrectionParams
- type Generation
- type GenerationParams
- type HTTPClient
- type HTTPError
- type ImageGeneration
- type ImageGenerationParams
- type IntentClassification
- type IntentClassificationParams
- type KwKpExtraction
- type KwKpExtractionParams
- type LangDetection
- type LangDetectionParams
- type Option
- type Paraphrasing
- type ParaphrasingParams
- type Question
- type QuestionParams
- type ScoredLabel
- type SearchResult
- type Segment
- type SemanticSearch
- type SemanticSearchParams
- type SemanticSimilarity
- type SemanticSimilarityParams
- type SentenceDependencies
- type SentenceDependenciesParams
- type SentenceDependency
- type Sentiment
- type SentimentParams
- type SpeechSynthesis
- type SpeechSynthesisParams
- type Summarization
- type SummarizationParams
- type Token
- type Tokens
- type TokensParams
- type Translation
- type TranslationParams
- type Word
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ASR ¶ added in v1.1.25
type ASR struct { Text string `json:"text"` Duration int `json:"duration"` Language string `json:"language"` Segments []Segment `json:"segments"` Words []ASRWord `json:"words"` }
ASR holds the extracted text returned by the API.
type ASRParams ¶ added in v1.1.25
type ASRParams struct { URL *string `json:"url"` EncodedFile *string `json:"encoded_file"` InputLanguage *string `json:"input_language"` }
ASRParams wraps all the parameters for the "asr" endpoint.
type ASRWord ¶ added in v1.1.51
type ASRWord struct { ID int `json:"id"` Starter float64 `json:"start"` End float64 `json:"end"` Text string `json:"text"` Prob float64 `json:"prob"` }
Word holds an ASR word.
type AdGeneration ¶ added in v1.1.11
type AdGeneration struct {
GeneratedText string `json:"generated_text"`
}
AdGeneration holds the generated product description or ad returned by the API.
type AdGenerationParams ¶ added in v1.1.11
type AdGenerationParams struct {
Keywords []string `json:"keywords"`
}
AdGenerationParams wraps all the parameters for the "ad-generation" endpoint.
type Arc ¶
type Arc struct { Start int `json:"start"` End int `json:"end"` Label string `json:"label"` Text string `json:"text"` Dir string `json:"dir"` }
Arc holds information related to POS direction.
type Async ¶ added in v1.1.32
type Async struct {
URL string `json:"url"`
}
Async holds the information returned when making an async request.
type AsyncResult ¶ added in v1.1.33
type AsyncResultParams ¶ added in v1.1.33
type AsyncResultParams struct {
URL string `json:"url"`
}
AsyncResultParams wraps all the parameters for the "async-result" endpoint.
type BatchClassification ¶ added in v1.1.18
type BatchClassification struct {
Scores []float64 `json:"scores"`
}
BatchClassification holds a batch of scores returned by the API.
type BatchClassificationParams ¶ added in v1.1.18
type BatchClassificationParams struct { Texts []string `json:"texts"` Labels []string `json:"labels"` }
BatchClassificationParams wraps all the parameters for the "batch-classification" endpoint.
type BatchGeneration ¶ added in v1.1.39
type BatchGeneration struct {
Generations []Generation `json:"generations"`
}
BatchGeneration holds a batch of generations returned by the API.
type BatchGenerationParams ¶ added in v1.1.39
type BatchGenerationParams struct {
Texts []string `json:"texts"`
}
BatchGenerationParams wraps all the parameters for the "batch-generation" endpoint.
type BatchSummarization ¶ added in v1.1.7
type BatchSummarization struct {
SummaryTexts []string `json:"summary_texts"`
}
BatchSummarization holds a batch of summarized texts returned by the API.
type BatchSummarizationParams ¶ added in v1.1.7
BatchSummarizationParams wraps all the parameters for the "batch-summarization" endpoint.
type BatchTranslation ¶ added in v1.1.15
type BatchTranslation struct {
TranslationTexts []string `json:"translation_texts"`
}
BatchTranslation holds a batch of translated texts returned by the API.
type BatchTranslationParams ¶ added in v1.1.15
type BatchTranslationParams struct { Texts []string `json:"texts"` Sources *[]string `json:"sources,omitempty"` Targets *[]string `json:"targets,omitempty"` }
BatchTranslationParams wraps all the parameters for the "batch-translation" endpoint.
type ChatbotParams ¶ added in v1.1.11
type ChatbotParams struct { Input string `json:"input"` History *[]Exchange `json:"history,omitempty"` Context *string `json:"context,omitempty"` }
ChatbotParams wraps all the parameters for the "chatbot" endpoint.
type Classification ¶
Classification holds the text classification returned by the API.
type ClassificationParams ¶ added in v1.1.0
type ClassificationParams struct { Text string `json:"text"` Labels *[]string `json:"labels,omitempty"` MultiClass *bool `json:"multi_class,omitempty"` }
ClassificationParams wraps all the parameters for the "classification" endpoint.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds the necessary information to connect to API.
func NewClient ¶
func NewClient(client HTTPClient, clientParams ClientParams) *Client
NewClient initializes a new Client.
func (*Client) AdGeneration ¶ added in v1.1.11
func (c *Client) AdGeneration(params AdGenerationParams, opts ...Option) (*AdGeneration, error)
AdGeneration generates a product description or an ad by contacting the API.
func (*Client) AsyncResult ¶ added in v1.1.33
func (c *Client) AsyncResult(params AsyncResultParams, opts ...Option) (*AsyncResult, error)
AsyncResult extracts gets an async result by contacting the API.
func (*Client) BatchClassification ¶ added in v1.1.18
func (c *Client) BatchClassification(params BatchClassificationParams, opts ...Option) (*BatchClassification, error)
BatchClassification classifies a batch of blocks of text by contacting the API.
func (*Client) BatchGeneration ¶ added in v1.1.39
func (c *Client) BatchGeneration(params BatchGenerationParams) (*BatchGeneration, error)
BatchGeneration generates a batch of blocks of text by contacting the API.
func (*Client) BatchSummarization ¶ added in v1.1.7
func (c *Client) BatchSummarization(params BatchSummarizationParams, opts ...Option) (*BatchSummarization, error)
BatchSummarization summarizes a batch of blocks of text by contacting the API.
func (*Client) BatchTranslation ¶ added in v1.1.15
func (c *Client) BatchTranslation(params BatchTranslationParams, opts ...Option) (*BatchTranslation, error)
BatchTranslation translates a batch of blocks of text by contacting the API.
func (*Client) Chatbot ¶ added in v1.1.11
func (c *Client) Chatbot(params ChatbotParams, opts ...Option) (*Chatbot, error)
Chatbot responds as a human by contacting the API.
func (*Client) Classification ¶
func (c *Client) Classification(params ClassificationParams, opts ...Option) (*Classification, error)
Classification applies scored labels to a block of text by contacting the API.
func (*Client) CodeGeneration ¶ added in v1.1.20
func (c *Client) CodeGeneration(params CodeGenerationParams, opts ...Option) (*CodeGeneration, error)
CodeGeneration generates source code by contacting the API.
func (*Client) Dependencies ¶
func (c *Client) Dependencies(params DependenciesParams, opts ...Option) (*Dependencies, error)
Dependencies gets POS dependencies from a block of text by contacting the API.
func (*Client) Embeddings ¶ added in v1.1.14
func (c *Client) Embeddings(params EmbeddingsParams, opts ...Option) (*Embeddings, error)
Embeddings extracts embeddings from a list of sentences by contacting the API.
func (*Client) Entities ¶
func (c *Client) Entities(params EntitiesParams, opts ...Option) (*Entities, error)
Entities extracts entities from a block of text by contacting the API.
func (*Client) GSCorrection ¶ added in v1.1.11
func (c *Client) GSCorrection(params GSCorrectionParams, opts ...Option) (*GSCorrection, error)
GSCorrection corrects the grammar and spelling by contacting the API.
func (*Client) Generation ¶ added in v1.1.0
func (c *Client) Generation(params GenerationParams, opts ...Option) (*Generation, error)
Generation generates a block of text by contacting the API.
func (*Client) ImageGeneration ¶ added in v1.1.24
func (c *Client) ImageGeneration(params ImageGenerationParams, opts ...Option) (*ImageGeneration, error)
ImageGeneration generates an image out of a text instruction by contacting the API.
func (*Client) IntentClassification ¶ added in v1.1.11
func (c *Client) IntentClassification(params IntentClassificationParams, opts ...Option) (*IntentClassification, error)
IntentClassification classifies intent from a block of text by contacting the API.
func (*Client) KwKpExtraction ¶ added in v1.1.11
func (c *Client) KwKpExtraction(params KwKpExtractionParams, opts ...Option) (*KwKpExtraction, error)
AdGeneration generates a product description or an ad by contacting the API.
func (*Client) LangDetection ¶ added in v1.1.0
func (c *Client) LangDetection(params LangDetectionParams, opts ...Option) (*LangDetection, error)
LangDetection returns an estimation of the text language by contacting the API.
func (*Client) Paraphrasing ¶ added in v1.1.10
func (c *Client) Paraphrasing(params ParaphrasingParams, opts ...Option) (*Paraphrasing, error)
Paraphrasing paraphrases a block of text by contacting the API.
func (*Client) Question ¶
func (c *Client) Question(params QuestionParams, opts ...Option) (*Question, error)
Question answers a question with a context by contacting the API.
func (*Client) SemanticSearch ¶ added in v1.1.27
func (c *Client) SemanticSearch(params SemanticSearchParams, opts ...Option) (*SemanticSearch, error)
SemanticSearch performs semantic search on custom data contacting the API.
func (*Client) SemanticSimilarity ¶ added in v1.1.14
func (c *Client) SemanticSimilarity(params SemanticSimilarityParams, opts ...Option) (*SemanticSimilarity, error)
SemanticSimilarity calculates a semantic similarity score out of 2 sentences by contacting the API.
func (*Client) SentenceDependencies ¶
func (c *Client) SentenceDependencies(params SentenceDependenciesParams, opts ...Option) (*SentenceDependencies, error)
SentenceDependencies gets POS dependencies with arcs from a block of text by contacting the API.
func (*Client) Sentiment ¶
func (c *Client) Sentiment(params SentimentParams, opts ...Option) (*Sentiment, error)
Sentiment defines the sentime of a block of text by contacting the API.
func (*Client) SpeechSynthesis ¶ added in v1.1.40
func (c *Client) SpeechSynthesis(params SpeechSynthesisParams, opts ...Option) (*SpeechSynthesis, error)
SpeechSynthesis generates audio out of a text by contacting the API.
func (*Client) StreamingChatbot ¶ added in v1.1.48
func (c *Client) StreamingChatbot(params ChatbotParams, opts ...Option) (io.ReadCloser, error)
StreamingChatbot responds as a human by contacting the API, and returns a stream.
func (*Client) StreamingGeneration ¶ added in v1.1.48
func (c *Client) StreamingGeneration(params GenerationParams, opts ...Option) (io.ReadCloser, error)
StreamingGeneration generates a block of text by contacting the API, and returns a stream.
func (*Client) Summarization ¶
func (c *Client) Summarization(params SummarizationParams, opts ...Option) (*Summarization, error)
Summarization summarizes a block of text by contacting the API.
func (*Client) Tokens ¶ added in v1.1.0
func (c *Client) Tokens(params TokensParams, opts ...Option) (*Tokens, error)
Tokens tokenize and lemmatize text by calling the API.
func (*Client) Translation ¶ added in v1.0.9
func (c *Client) Translation(params TranslationParams, opts ...Option) (*Translation, error)
Translation translates a block of text by contacting the API.
type ClientParams ¶ added in v1.1.46
ClientParams wraps all the parameters for the client initialization.
type CodeGeneration ¶ added in v1.1.20
type CodeGeneration struct {
GeneratedCode string `json:"generated_code"`
}
CodeGeneration holds the generated code returned by the API.
type CodeGenerationParams ¶ added in v1.1.20
type CodeGenerationParams struct {
Intruction string `json:"instruction"`
}
CodeGenerationParams wraps all the parameters for the "code-generation" endpoint.
type Dependencies ¶
Dependencies holds a list of POS dependencies returned by the API.
type DependenciesParams ¶ added in v1.1.0
type DependenciesParams struct {
Text string `json:"text"`
}
DependenciesParams wraps all the parameters for the "dependencies" endpoint.
type Embeddings ¶ added in v1.1.14
type Embeddings struct {
Embeddings [][]float64 `json:"embeddings"`
}
type EmbeddingsParams ¶ added in v1.1.14
type EmbeddingsParams struct {
Sentences []string `json:"sentences"`
}
EmbeddingsParams wraps all the parameters for the "embeddings" endpoint.
type Entities ¶
type Entities struct {
Entities []Entity `json:"entities"`
}
Entities holds a list of NER entities returned by the API.
type EntitiesParams ¶ added in v1.1.0
type EntitiesParams struct { Text string `json:"text"` SearchedEntity *string `json:"searched_entity,omitempty"` }
EntitiesParams wraps all the parameters for the "entities" endpoint.
type Entity ¶
type Entity struct { Start int `json:"start"` End int `json:"end"` Type string `json:"type"` Text string `json:"text"` }
Entity holds an NER entity returned by the API.
type GSCorrection ¶ added in v1.1.11
type GSCorrection struct {
Correction string `json:"correction"`
}
GSCorrection holds the corrected text returned by the API.
type GSCorrectionParams ¶ added in v1.1.11
type GSCorrectionParams struct {
Text string `json:"text"`
}
GSCorrectionParams wraps all the parameters for the "gs-correction" endpoint.
type Generation ¶ added in v1.1.0
type Generation struct { GeneratedText string `json:"generated_text"` NbGeneratedTokens int `json:"nb_generated_tokens"` NbInputTokens int `json:"nb_input_tokens"` }
Generation holds a generated text returned by the API.
type GenerationParams ¶ added in v1.1.0
type GenerationParams struct { Text string `json:"text"` MaxLength *int `json:"max_length,omitempty"` LengthNoInput *bool `json:"length_no_input,omitempty"` EndSequence *string `json:"end_sequence,omitempty"` RemoveInput *bool `json:"remove_input,omitempty"` NumBeams *int `json:"num_beams,omitempty"` NumReturnSequences *int `json:"num_return_sequences,omitempty"` TopK *int `json:"top_k,omitempty"` TopP *float64 `json:"top_p,omitempty"` Temperature *float64 `json:"temperature,omitempty"` RepetitionPenalty *float64 `json:"repetition_penalty,omitempty"` BadWords *[]string `json:"bad_words,omitempty"` RemoveEndSequence *bool `json:"remove_end_sequence,omitempty"` // NoChatPrompt is experimental. It is not suited for production. NoChatPrompt *bool `json:"no_chat_prompt,omitempty"` }
GenerationParams wraps all the parameters for the "generation" endpoint.
type HTTPClient ¶ added in v1.1.0
HTTPClient defines what a HTTP client have to implement in order to get used by the Client.
type HTTPError ¶ added in v1.1.5
HTTPError is an error type returned when the HTTP request is failing.
func (HTTPError) GetStatusCode ¶ added in v1.1.5
type ImageGeneration ¶ added in v1.1.24
type ImageGeneration struct {
URL string `json:"url"`
}
ImageGeneration holds the generated image url returned by the API.
type ImageGenerationParams ¶ added in v1.1.24
type ImageGenerationParams struct {
Text string `json:"text"`
}
ImageGenerationParams wraps all the parameters for the "image-generation" endpoint.
type IntentClassification ¶ added in v1.1.11
type IntentClassification struct {
Intent string `json:"intent"`
}
IntentClassification holds the classified intent returned by the API.
type IntentClassificationParams ¶ added in v1.1.11
type IntentClassificationParams struct {
Text string `json:"text"`
}
IntentClassificationParams wraps all the parameters for the "intent-classification" endpoint.
type KwKpExtraction ¶ added in v1.1.11
type KwKpExtraction struct {
KeywordsAndKeyphrases []string `json:"keywords_and_keyphrases"`
}
KwKpExtraction holds the extracted keywords and keyphrases returned by the API.
type KwKpExtractionParams ¶ added in v1.1.11
type KwKpExtractionParams struct {
Text string `json:"text"`
}
KwKpExtractionParams wraps all the parameters for the "kw-kp-extraction" endpoint.
type LangDetection ¶ added in v1.1.0
LangDetection holds the languages of a text returned by the API.
type LangDetectionParams ¶ added in v1.1.0
type LangDetectionParams struct { // Text should not exceed 100.000 characters. Text string `json:"text"` }
LangDetectionParams wraps all the parameters for the "langdetection" endpoint.
type Option ¶ added in v1.1.23
type Option interface {
// contains filtered or unexported methods
}
func WithContext ¶ added in v1.1.23
WithContext returns an Option that defines the context.Context to use with issuing a request. Default is context.Background.
type Paraphrasing ¶ added in v1.1.10
type Paraphrasing struct {
ParaphrasedText string `json:"paraphrased_text"`
}
Paraphrasing holds a paraphrased text returned by the API.
type ParaphrasingParams ¶ added in v1.1.10
type ParaphrasingParams struct {
Text string `json:"text"`
}
ParaphrasingParams wraps all the parameters for the "paraphrasing" endpoint.
type Question ¶
type Question struct { Answer string `json:"answer"` Score float64 `json:"score"` Start int `json:"start"` End int `json:"end"` }
Question holds the answer to a question by the API.
type QuestionParams ¶ added in v1.1.0
type QuestionParams struct { Question string `json:"question"` Context *string `json:"context,omitempty"` }
QuestionParams wraps all the parameters for the "question" endpoint.
type ScoredLabel ¶
ScoredLabel holds a label and its score for sentiment analysis.
type SearchResult ¶ added in v1.1.27
SearchResult holds a search result from semantic search.
type Segment ¶ added in v1.1.31
type Segment struct { ID int `json:"id"` Starter float64 `json:"start"` End float64 `json:"end"` Text string `json:"text"` }
Segment holds an ASR segment.
type SemanticSearch ¶ added in v1.1.27
type SemanticSearch struct {
SearchResults []SearchResult `json:"search_results"`
}
SemanticSearch holds semantic search results returned by the API.
type SemanticSearchParams ¶ added in v1.1.27
SemanticSearchParams wraps all the parameters for the "semantic-search" endpoint.
type SemanticSimilarity ¶ added in v1.1.14
type SemanticSimilarity struct {
Score float64 `json:"score"`
}
SemanticSimilarity holds semantic similarity score returned by the API.
type SemanticSimilarityParams ¶ added in v1.1.14
type SemanticSimilarityParams struct {
Sentences [2]string `json:"sentences"`
}
SemanticSimilarityParams wraps all the parameters for the "semantic-similarity" endpoint.
type SentenceDependencies ¶
type SentenceDependencies struct {
SentenceDependencies []SentenceDependency `json:"sentence_dependencies"`
}
SentenceDependencies holds a list of POS dependencies for several sentences returned by the API.
type SentenceDependenciesParams ¶ added in v1.1.0
type SentenceDependenciesParams struct {
Text string `json:"text"`
}
SentenceDependenciesParams wraps all the parameters for the "sentence-dependencies" endpoint.
type SentenceDependency ¶
type SentenceDependency struct { Sentence string `json:"sentence"` Dependencies Dependencies `json:"dependencies"` }
SentenceDependency holds a POS dependency for one sentence returned by the API.
type Sentiment ¶
type Sentiment struct {
ScoredLabels []ScoredLabel `json:"scored_labels"`
}
Sentiment holds the sentiment of a text returned by the API.
type SentimentParams ¶ added in v1.1.0
SentimentParams wraps all the parameters for the "sentiment" endpoint.
type SpeechSynthesis ¶ added in v1.1.40
type SpeechSynthesis struct {
URL string `json:"url"`
}
SpeechSynthesis holds the generated audio file url returned by the API.
type SpeechSynthesisParams ¶ added in v1.1.40
SpeechSynthesisParams wraps all the parameters for the "speech-synthesis" endpoint.
type Summarization ¶
type Summarization struct {
SummaryText string `json:"summary_text"`
}
Summarization holds a summarized text returned by the API.
type SummarizationParams ¶ added in v1.1.0
SummarizationParams wraps all the parameters for the "summarization" endpoint.
type Token ¶ added in v1.1.0
type Token struct { Text string `json:"text"` Lemma string `json:"lemma"` Start int `json:"start"` End int `json:"end"` Index int `json:"index"` WSAfter bool `json:"ws_after"` }
Token holds a token value from Tokens.
type Tokens ¶ added in v1.1.0
type Tokens struct {
Tokens []Token `json:"tokens"`
}
Tokens holds a list of Token returned by the API.
type TokensParams ¶ added in v1.1.0
type TokensParams struct {
Text string `json:"text"`
}
TokensParams wraps all the parameters for the "tokens" endpoint.
type Translation ¶ added in v1.0.9
type Translation struct {
TranslationText string `json:"translation_text"`
}
Translation holds a translated text returned by the API.
type TranslationParams ¶ added in v1.1.0
type TranslationParams struct { Text string `json:"text"` Source *string `json:"source,omitempty"` Target *string `json:"target,omitempty"` }
TranslationParams wraps all the parameters for the "translation" endpoint.