1
0

infer-api-task.asciidoc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // tag::cohere[]
  2. [source,console]
  3. ------------------------------------------------------------
  4. PUT _inference/text_embedding/cohere_embeddings <1>
  5. {
  6. "service": "cohere",
  7. "service_settings": {
  8. "api_key": "<api_key>", <2>
  9. "model_id": "embed-english-v3.0", <3>
  10. "embedding_type": "int8"
  11. },
  12. "task_settings": {
  13. }
  14. }
  15. ------------------------------------------------------------
  16. // TEST[skip:TBD]
  17. <1> The task type is `text_embedding` in the path.
  18. <2> The API key of your Cohere account. You can find your API keys in your
  19. Cohere dashboard under the
  20. https://dashboard.cohere.com/api-keys[API keys section]. You need to provide
  21. your API key only once. The <<get-inference-api>> does not return your API
  22. key.
  23. <3> The name of the embedding model to use. You can find the list of Cohere
  24. embedding models https://docs.cohere.com/reference/embed[here].
  25. // end::cohere[]
  26. // tag::openai[]
  27. [source,console]
  28. ------------------------------------------------------------
  29. PUT _inference/text_embedding/openai_embeddings <1>
  30. {
  31. "service": "openai",
  32. "service_settings": {
  33. "api_key": "<api_key>", <2>
  34. "model_id": "text-embedding-ada-002" <3>
  35. },
  36. "task_settings": {
  37. }
  38. }
  39. ------------------------------------------------------------
  40. // TEST[skip:TBD]
  41. <1> The task type is `text_embedding` in the path.
  42. <2> The API key of your OpenAI account. You can find your OpenAI API keys in
  43. your OpenAI account under the
  44. https://platform.openai.com/api-keys[API keys section]. You need to provide
  45. your API key only once. The <<get-inference-api>> does not return your API
  46. key.
  47. <3> The name of the embedding model to use. You can find the list of OpenAI
  48. embedding models
  49. https://platform.openai.com/docs/guides/embeddings/embedding-models[here].
  50. // end::openai[]