You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Specifies the input type translation values that are used to replace the `${input_type}` template in the request body.
775
+
* For example:
776
+
* ```
777
+
* "input_type": {
778
+
* "translation": {
779
+
* "ingest": "do_ingest",
780
+
* "search": "do_search"
781
+
* },
782
+
* "default": "a_default"
783
+
* },
784
+
* ```
785
+
* If the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`.
786
+
* If it comes from the ingest context `do_ingest` is used. If it's a different context that is not specified, the default value will be used. If no default is specified an empty string is used.
787
+
* `translation` can be:
788
+
* * `classification`
789
+
* * `clustering`
790
+
* * `ingest`
791
+
* * `search`
792
+
*/
793
+
input_type?: UserDefinedValue
794
+
/**
795
+
* Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value.
796
+
* For example:
797
+
* ```
798
+
* "query_parameters":[
799
+
* ["param_key", "some_value"],
800
+
* ["param_key", "another_value"],
801
+
* ["other_key", "other_value"]
802
+
* ]
803
+
* ```
804
+
* If the base url is `https://www.elastic.co` it results in: `https://www.elastic.co?param_key=some_value¶m_key=another_value&other_key=other_value`.
805
+
*/
806
+
query_parameters?: UserDefinedValue
807
+
/**
808
+
* The request configuration object.
809
+
*/
810
+
request: CustomRequestParams
811
+
/**
812
+
* The response configuration object.
813
+
*/
814
+
response: CustomResponseParams
815
+
/**
816
+
* Specifies secret parameters, like `api_key` or `api_token`, that are required to access the custom service.
817
+
* For example:
818
+
* ```
819
+
* "secret_parameters":{
820
+
* "api_key":"<api_key>"
821
+
* }
822
+
* ```
823
+
*/
824
+
secret_parameters: UserDefinedValue
825
+
/**
826
+
* The URL endpoint to use for the requests.
827
+
*/
828
+
url?: string
829
+
}
830
+
831
+
exportclassCustomRequestParams{
832
+
/**
833
+
* The body structure of the request. It requires passing in the string-escaped result of the JSON format HTTP request body.
834
+
* For example:
835
+
* ```
836
+
* "request": "{\"input\":${input}}"
837
+
* ```
838
+
* > info
839
+
* > The content string needs to be a single line except when using the Kibana console.
840
+
*/
841
+
content: string
842
+
}
843
+
844
+
exportclassCustomResponseParams{
845
+
/**
846
+
* Specifies the JSON parser that is used to parse the response from the custom service.
847
+
* Different task types require different json_parser parameters.
848
+
* For example:
849
+
* ```
850
+
* # text_embedding
851
+
* # For a response like this:
852
+
*
853
+
* {
854
+
* "object": "list",
855
+
* "data": [
856
+
* {
857
+
* "object": "embedding",
858
+
* "index": 0,
859
+
* "embedding": [
860
+
* 0.014539449,
861
+
* -0.015288644
862
+
* ]
863
+
* }
864
+
* ],
865
+
* "model": "text-embedding-ada-002-v2",
866
+
* "usage": {
867
+
* "prompt_tokens": 8,
868
+
* "total_tokens": 8
869
+
* }
870
+
* }
871
+
*
872
+
* # the json_parser definition should look like this:
0 commit comments