Add OpenAI Mock Server (#31)

* add constants for completions, refactor usage, add test server

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

* append v1 endpoint to test

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

* add makefile for easy targets

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

* lint files & add linter

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

* disable real API tests in short mode

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>
This commit is contained in:
Oleg
2022-08-11 05:29:23 -04:00
committed by GitHub
parent 8b463ceb2b
commit d63df93c65
12 changed files with 619 additions and 61 deletions

View File

@@ -92,11 +92,12 @@ var stringToEnum = map[string]EmbeddingModel{
"code-search-babbage-text-001": BabbageCodeSearchText,
}
// Embedding is a special format of data representation that can be easily utilized by machine learning models and algorithms.
// The embedding is an information dense representation of the semantic meaning of a piece of text. Each embedding is a vector of
// floating point numbers, such that the distance between two embeddings in the vector space is correlated with semantic similarity
// between two inputs in the original format. For example, if two texts are similar, then their vector representations should
// also be similar.
// Embedding is a special format of data representation that can be easily utilized by machine
// learning models and algorithms. The embedding is an information dense representation of the
// semantic meaning of a piece of text. Each embedding is a vector of floating point numbers,
// such that the distance between two embeddings in the vector space is correlated with semantic similarity
// between two inputs in the original format. For example, if two texts are similar,
// then their vector representations should also be similar.
type Embedding struct {
Object string `json:"object"`
Embedding []float64 `json:"embedding"`