Skip to main content

Generate Embeddings

Generate embeddings from a model.

Using embed()

Loading code...
LLM Response
[
[
0.010000081,
-0.0017487297,
0.050126992,
0.04694895,
0.055186987,
0.008570699,
0.10545243,
-0.02591801,
0.1296789,
],
[
-0.009868476,
0.060335685,
0.025288988,
-0.0062160683,
0.07281043,
0.017217565,
0.090314455,
-0.051715206,
]
]

You could also use the OllamaEmbedRequestModel to specify the options such as seed, temperature, etc., to apply for generating embeddings.

Loading code...

You will get a response similar to:

LLM Response
[
[
0.010000081,
-0.0017487297,
0.050126992,
0.04694895,
0.055186987,
0.008570699,
0.10545243,
-0.02591801,
0.1296789,
],
[
-0.009868476,
0.060335685,
0.025288988,
-0.0062160683,
0.07281043,
0.017217565,
0.090314455,
-0.051715206,
]
]