oci-generativeaiinference 2.77.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +89 -0
- package/NOTICE.txt +1 -0
- package/README.md +22 -0
- package/THIRD_PARTY_LICENSES.txt +576 -0
- package/index.d.ts +27 -0
- package/index.js +50 -0
- package/index.js.map +1 -0
- package/lib/client.d.ts +113 -0
- package/lib/client.js +376 -0
- package/lib/client.js.map +1 -0
- package/lib/model/choice.d.ts +45 -0
- package/lib/model/choice.js +60 -0
- package/lib/model/choice.js.map +1 -0
- package/lib/model/cohere-llm-inference-request.d.ts +106 -0
- package/lib/model/cohere-llm-inference-request.js +73 -0
- package/lib/model/cohere-llm-inference-request.js.map +1 -0
- package/lib/model/cohere-llm-inference-response.d.ts +43 -0
- package/lib/model/cohere-llm-inference-response.js +73 -0
- package/lib/model/cohere-llm-inference-response.js.map +1 -0
- package/lib/model/dedicated-serving-mode.d.ts +35 -0
- package/lib/model/dedicated-serving-mode.js +59 -0
- package/lib/model/dedicated-serving-mode.js.map +1 -0
- package/lib/model/embed-text-details.d.ts +61 -0
- package/lib/model/embed-text-details.js +75 -0
- package/lib/model/embed-text-details.js.map +1 -0
- package/lib/model/embed-text-result.d.ts +48 -0
- package/lib/model/embed-text-result.js +36 -0
- package/lib/model/embed-text-result.js.map +1 -0
- package/lib/model/generate-text-details.d.ts +35 -0
- package/lib/model/generate-text-details.js +68 -0
- package/lib/model/generate-text-details.js.map +1 -0
- package/lib/model/generate-text-result.d.ts +38 -0
- package/lib/model/generate-text-result.js +64 -0
- package/lib/model/generate-text-result.js.map +1 -0
- package/lib/model/generated-text.d.ts +55 -0
- package/lib/model/generated-text.js +68 -0
- package/lib/model/generated-text.js.map +1 -0
- package/lib/model/index.d.ts +57 -0
- package/lib/model/index.js +80 -0
- package/lib/model/index.js.map +1 -0
- package/lib/model/llama-llm-inference-request.d.ts +94 -0
- package/lib/model/llama-llm-inference-request.js +61 -0
- package/lib/model/llama-llm-inference-request.js.map +1 -0
- package/lib/model/llama-llm-inference-response.d.ts +39 -0
- package/lib/model/llama-llm-inference-response.js +73 -0
- package/lib/model/llama-llm-inference-response.js.map +1 -0
- package/lib/model/llm-inference-request.d.ts +29 -0
- package/lib/model/llm-inference-request.js +79 -0
- package/lib/model/llm-inference-request.js.map +1 -0
- package/lib/model/llm-inference-response.d.ts +29 -0
- package/lib/model/llm-inference-response.js +79 -0
- package/lib/model/llm-inference-response.js.map +1 -0
- package/lib/model/logprobs.d.ts +46 -0
- package/lib/model/logprobs.js +36 -0
- package/lib/model/logprobs.js.map +1 -0
- package/lib/model/on-demand-serving-mode.d.ts +35 -0
- package/lib/model/on-demand-serving-mode.js +59 -0
- package/lib/model/on-demand-serving-mode.js.map +1 -0
- package/lib/model/serving-mode.d.ts +29 -0
- package/lib/model/serving-mode.js +79 -0
- package/lib/model/serving-mode.js.map +1 -0
- package/lib/model/summarize-text-details.d.ts +82 -0
- package/lib/model/summarize-text-details.js +82 -0
- package/lib/model/summarize-text-details.js.map +1 -0
- package/lib/model/summarize-text-result.d.ts +48 -0
- package/lib/model/summarize-text-result.js +36 -0
- package/lib/model/summarize-text-result.js.map +1 -0
- package/lib/model/token-likelihood.d.ts +39 -0
- package/lib/model/token-likelihood.js +36 -0
- package/lib/model/token-likelihood.js.map +1 -0
- package/lib/request/embed-text-request.d.ts +36 -0
- package/lib/request/embed-text-request.js +15 -0
- package/lib/request/embed-text-request.js.map +1 -0
- package/lib/request/generate-text-request.d.ts +36 -0
- package/lib/request/generate-text-request.js +15 -0
- package/lib/request/generate-text-request.js.map +1 -0
- package/lib/request/index.d.ts +25 -0
- package/lib/request/index.js +22 -0
- package/lib/request/index.js.map +1 -0
- package/lib/request/summarize-text-request.d.ts +36 -0
- package/lib/request/summarize-text-request.js +15 -0
- package/lib/request/summarize-text-request.js.map +1 -0
- package/lib/response/embed-text-response.d.ts +30 -0
- package/lib/response/embed-text-response.js +15 -0
- package/lib/response/embed-text-response.js.map +1 -0
- package/lib/response/generate-text-response.d.ts +30 -0
- package/lib/response/generate-text-response.js +15 -0
- package/lib/response/generate-text-response.js.map +1 -0
- package/lib/response/index.d.ts +25 -0
- package/lib/response/index.js +22 -0
- package/lib/response/index.js.map +1 -0
- package/lib/response/summarize-text-response.d.ts +30 -0
- package/lib/response/summarize-text-response.js +15 -0
- package/lib/response/summarize-text-response.js.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generative AI Service Inference API
|
|
3
|
+
* OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings.
|
|
4
|
+
|
|
5
|
+
Use the Generative AI service inference API to access your custom model endpoints, or to try the out-of-the-box models to [generate text](#/en/generative-ai-inference/latest/GenerateTextResult/GenerateText), [summarize](#/en/generative-ai-inference/latest/SummarizeTextResult/SummarizeText), and [create text embeddings](#/en/generative-ai-inference/latest/EmbedTextResult/EmbedText).
|
|
6
|
+
|
|
7
|
+
To use a Generative AI custom model for inference, you must first create an endpoint for that model. Use the [Generative AI service management API](/#/en/generative-ai/latest/) to [create a custom model](#/en/generative-ai/latest/Model/) by fine-tuning an out-of-the-box model, or a previous version of a custom model, using your own data. Fine-tune the custom model on a [fine-tuning dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/). Then, create a [hosting dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/) with an [endpoint](#/en/generative-ai/latest/Endpoint/) to host your custom model. For resource management in the Generative AI service, use the [Generative AI service management API](/#/en/generative-ai/latest/).
|
|
8
|
+
|
|
9
|
+
To learn more about the service, see the [Generative AI documentation](/iaas/Content/generative-ai/home.htm).
|
|
10
|
+
|
|
11
|
+
* OpenAPI spec version: 20231130
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* NOTE: This class is auto generated by OracleSDKGenerator.
|
|
15
|
+
* Do not edit the class manually.
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
|
18
|
+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
|
19
|
+
*/
|
|
20
|
+
import * as model from "../model";
|
|
21
|
+
/**
|
|
22
|
+
* Details for the text generation request for Llama models.
|
|
23
|
+
*/
|
|
24
|
+
export interface LlamaLlmInferenceRequest extends model.LlmInferenceRequest {
|
|
25
|
+
/**
|
|
26
|
+
* Represents the prompt to be completed. The trailing white spaces are trimmed before completion.
|
|
27
|
+
*/
|
|
28
|
+
"prompt"?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to stream back partial progress. If set, tokens are sent as data-only server-sent events as they become available.
|
|
31
|
+
*/
|
|
32
|
+
"isStream"?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The number of of generated texts that will be returned. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
35
|
+
*/
|
|
36
|
+
"numGenerations"?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Whether or not to return the user prompt in the response. Applies only to non-stream results.
|
|
39
|
+
*/
|
|
40
|
+
"isEcho"?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* An integer that sets up the model to use only the top k most likely tokens in the generated output. A higher k introduces more randomness into the output making the output text sound more natural. Default value is -1 which means to consider all tokens. Setting to 0 disables this method and considers all tokens.
|
|
43
|
+
* <p>
|
|
44
|
+
If also using top p, then the model considers only the top tokens whose probabilities add up to p percent and ignores the rest of the k tokens. For example, if k is 20, but the probabilities of the top 10 add up to .75, then only the top 10 tokens are chosen.
|
|
45
|
+
* Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
46
|
+
*/
|
|
47
|
+
"topK"?: number;
|
|
48
|
+
/**
|
|
49
|
+
* If set to a probability 0.0 < p < 1.0, it ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step.
|
|
50
|
+
* <p>
|
|
51
|
+
To eliminate tokens with low likelihood, assign p a minimum percentage for the next token's likelihood. For example, when p is set to 0.75, the model eliminates the bottom 25 percent for the next token. Set to 1 to consider all tokens and set to 0 to disable. If both k and p are enabled, p acts after k.
|
|
52
|
+
* Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
53
|
+
*/
|
|
54
|
+
"topP"?: number;
|
|
55
|
+
/**
|
|
56
|
+
* A number that sets the randomness of the generated output. A lower temperature means a less random generations.
|
|
57
|
+
* <p>
|
|
58
|
+
Use lower numbers for tasks with a correct answer such as question answering or summarizing. High temperatures can generate hallucinations or factually incorrect information. Start with temperatures lower than 1.0 and increase the temperature for more creative outputs, as you regenerate the prompts to refine the outputs.
|
|
59
|
+
* Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
60
|
+
*/
|
|
61
|
+
"temperature"?: number;
|
|
62
|
+
/**
|
|
63
|
+
* To reduce repetitiveness of generated tokens, this number penalizes new tokens based on their frequency in the generated text so far. Values > 0 encourage the model to use new tokens and values < 0 encourage the model to repeat tokens. Set to 0 to disable. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
64
|
+
*/
|
|
65
|
+
"frequencyPenalty"?: number;
|
|
66
|
+
/**
|
|
67
|
+
* To reduce repetitiveness of generated tokens, this number penalizes new tokens based on whether they've appeared in the generated text so far. Values > 0 encourage the model to use new tokens and values < 0 encourage the model to repeat tokens.
|
|
68
|
+
* <p>
|
|
69
|
+
Similar to frequency penalty, a penalty is applied to previously present tokens, except that this penalty is applied equally to all tokens that have already appeared, regardless of how many times they've appeared. Set to 0 to disable.
|
|
70
|
+
* Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
71
|
+
*/
|
|
72
|
+
"presencePenalty"?: number;
|
|
73
|
+
/**
|
|
74
|
+
* List of strings that stop the generation if they are generated for the response text. The returned output will not contain the stop strings.
|
|
75
|
+
*/
|
|
76
|
+
"stop"?: Array<string>;
|
|
77
|
+
/**
|
|
78
|
+
* Includes the logarithmic probabilities for the most likely output tokens and the chosen tokens.
|
|
79
|
+
* <p>
|
|
80
|
+
For example, if the log probability is 5, the API returns a list of the 5 most likely tokens. The API returns the log probability of the sampled token, so there might be up to logprobs+1 elements in the response.
|
|
81
|
+
* Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
82
|
+
*/
|
|
83
|
+
"logProbs"?: number;
|
|
84
|
+
/**
|
|
85
|
+
* The maximum number of tokens to predict for each response. Includes input plus output tokens. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
86
|
+
*/
|
|
87
|
+
"maxTokens"?: number;
|
|
88
|
+
"runtimeType": string;
|
|
89
|
+
}
|
|
90
|
+
export declare namespace LlamaLlmInferenceRequest {
|
|
91
|
+
function getJsonObj(obj: LlamaLlmInferenceRequest, isParentJsonObj?: boolean): object;
|
|
92
|
+
const runtimeType = "LLAMA";
|
|
93
|
+
function getDeserializedJsonObj(obj: LlamaLlmInferenceRequest, isParentJsonObj?: boolean): object;
|
|
94
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generative AI Service Inference API
|
|
4
|
+
* OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings.
|
|
5
|
+
|
|
6
|
+
Use the Generative AI service inference API to access your custom model endpoints, or to try the out-of-the-box models to [generate text](#/en/generative-ai-inference/latest/GenerateTextResult/GenerateText), [summarize](#/en/generative-ai-inference/latest/SummarizeTextResult/SummarizeText), and [create text embeddings](#/en/generative-ai-inference/latest/EmbedTextResult/EmbedText).
|
|
7
|
+
|
|
8
|
+
To use a Generative AI custom model for inference, you must first create an endpoint for that model. Use the [Generative AI service management API](/#/en/generative-ai/latest/) to [create a custom model](#/en/generative-ai/latest/Model/) by fine-tuning an out-of-the-box model, or a previous version of a custom model, using your own data. Fine-tune the custom model on a [fine-tuning dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/). Then, create a [hosting dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/) with an [endpoint](#/en/generative-ai/latest/Endpoint/) to host your custom model. For resource management in the Generative AI service, use the [Generative AI service management API](/#/en/generative-ai/latest/).
|
|
9
|
+
|
|
10
|
+
To learn more about the service, see the [Generative AI documentation](/iaas/Content/generative-ai/home.htm).
|
|
11
|
+
|
|
12
|
+
* OpenAPI spec version: 20231130
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* NOTE: This class is auto generated by OracleSDKGenerator.
|
|
16
|
+
* Do not edit the class manually.
|
|
17
|
+
*
|
|
18
|
+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
|
19
|
+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
|
20
|
+
*/
|
|
21
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.LlamaLlmInferenceRequest = void 0;
|
|
42
|
+
const model = __importStar(require("../model"));
|
|
43
|
+
var LlamaLlmInferenceRequest;
|
|
44
|
+
(function (LlamaLlmInferenceRequest) {
|
|
45
|
+
function getJsonObj(obj, isParentJsonObj) {
|
|
46
|
+
const jsonObj = Object.assign(Object.assign({}, (isParentJsonObj
|
|
47
|
+
? obj
|
|
48
|
+
: model.LlmInferenceRequest.getJsonObj(obj))), {});
|
|
49
|
+
return jsonObj;
|
|
50
|
+
}
|
|
51
|
+
LlamaLlmInferenceRequest.getJsonObj = getJsonObj;
|
|
52
|
+
LlamaLlmInferenceRequest.runtimeType = "LLAMA";
|
|
53
|
+
function getDeserializedJsonObj(obj, isParentJsonObj) {
|
|
54
|
+
const jsonObj = Object.assign(Object.assign({}, (isParentJsonObj
|
|
55
|
+
? obj
|
|
56
|
+
: model.LlmInferenceRequest.getDeserializedJsonObj(obj))), {});
|
|
57
|
+
return jsonObj;
|
|
58
|
+
}
|
|
59
|
+
LlamaLlmInferenceRequest.getDeserializedJsonObj = getDeserializedJsonObj;
|
|
60
|
+
})(LlamaLlmInferenceRequest = exports.LlamaLlmInferenceRequest || (exports.LlamaLlmInferenceRequest = {}));
|
|
61
|
+
//# sourceMappingURL=llama-llm-inference-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llama-llm-inference-request.js","sourceRoot":"","sources":["../../../../../lib/generativeaiinference/lib/model/llama-llm-inference-request.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAkC;AA0ElC,IAAiB,wBAAwB,CAyBxC;AAzBD,WAAiB,wBAAwB;IACvC,SAAgB,UAAU,CAAC,GAA6B,EAAE,eAAyB;QACjF,MAAM,OAAO,mCACR,CAAC,eAAe;YACjB,CAAC,CAAC,GAAG;YACL,CAAC,CAAE,KAAK,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAA8B,CAAC,GACzE,EAAE,CACN,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IATe,mCAAU,aASzB,CAAA;IACY,oCAAW,GAAG,OAAO,CAAC;IACnC,SAAgB,sBAAsB,CACpC,GAA6B,EAC7B,eAAyB;QAEzB,MAAM,OAAO,mCACR,CAAC,eAAe;YACjB,CAAC,CAAC,GAAG;YACL,CAAC,CAAE,KAAK,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,GAAG,CAA8B,CAAC,GACrF,EAAE,CACN,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAZe,+CAAsB,yBAYrC,CAAA;AACH,CAAC,EAzBgB,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAyBxC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generative AI Service Inference API
|
|
3
|
+
* OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings.
|
|
4
|
+
|
|
5
|
+
Use the Generative AI service inference API to access your custom model endpoints, or to try the out-of-the-box models to [generate text](#/en/generative-ai-inference/latest/GenerateTextResult/GenerateText), [summarize](#/en/generative-ai-inference/latest/SummarizeTextResult/SummarizeText), and [create text embeddings](#/en/generative-ai-inference/latest/EmbedTextResult/EmbedText).
|
|
6
|
+
|
|
7
|
+
To use a Generative AI custom model for inference, you must first create an endpoint for that model. Use the [Generative AI service management API](/#/en/generative-ai/latest/) to [create a custom model](#/en/generative-ai/latest/Model/) by fine-tuning an out-of-the-box model, or a previous version of a custom model, using your own data. Fine-tune the custom model on a [fine-tuning dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/). Then, create a [hosting dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/) with an [endpoint](#/en/generative-ai/latest/Endpoint/) to host your custom model. For resource management in the Generative AI service, use the [Generative AI service management API](/#/en/generative-ai/latest/).
|
|
8
|
+
|
|
9
|
+
To learn more about the service, see the [Generative AI documentation](/iaas/Content/generative-ai/home.htm).
|
|
10
|
+
|
|
11
|
+
* OpenAPI spec version: 20231130
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* NOTE: This class is auto generated by OracleSDKGenerator.
|
|
15
|
+
* Do not edit the class manually.
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
|
18
|
+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
|
19
|
+
*/
|
|
20
|
+
import * as model from "../model";
|
|
21
|
+
/**
|
|
22
|
+
* The generated text result to return.
|
|
23
|
+
*/
|
|
24
|
+
export interface LlamaLlmInferenceResponse extends model.LlmInferenceResponse {
|
|
25
|
+
/**
|
|
26
|
+
* The Unix timestamp (in seconds) of when the generation was created.
|
|
27
|
+
*/
|
|
28
|
+
"created": Date;
|
|
29
|
+
/**
|
|
30
|
+
* A list of generated texts. Can be more than one if n is greater than 1.
|
|
31
|
+
*/
|
|
32
|
+
"choices": Array<model.Choice>;
|
|
33
|
+
"runtimeType": string;
|
|
34
|
+
}
|
|
35
|
+
export declare namespace LlamaLlmInferenceResponse {
|
|
36
|
+
function getJsonObj(obj: LlamaLlmInferenceResponse, isParentJsonObj?: boolean): object;
|
|
37
|
+
const runtimeType = "LLAMA";
|
|
38
|
+
function getDeserializedJsonObj(obj: LlamaLlmInferenceResponse, isParentJsonObj?: boolean): object;
|
|
39
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generative AI Service Inference API
|
|
4
|
+
* OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings.
|
|
5
|
+
|
|
6
|
+
Use the Generative AI service inference API to access your custom model endpoints, or to try the out-of-the-box models to [generate text](#/en/generative-ai-inference/latest/GenerateTextResult/GenerateText), [summarize](#/en/generative-ai-inference/latest/SummarizeTextResult/SummarizeText), and [create text embeddings](#/en/generative-ai-inference/latest/EmbedTextResult/EmbedText).
|
|
7
|
+
|
|
8
|
+
To use a Generative AI custom model for inference, you must first create an endpoint for that model. Use the [Generative AI service management API](/#/en/generative-ai/latest/) to [create a custom model](#/en/generative-ai/latest/Model/) by fine-tuning an out-of-the-box model, or a previous version of a custom model, using your own data. Fine-tune the custom model on a [fine-tuning dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/). Then, create a [hosting dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/) with an [endpoint](#/en/generative-ai/latest/Endpoint/) to host your custom model. For resource management in the Generative AI service, use the [Generative AI service management API](/#/en/generative-ai/latest/).
|
|
9
|
+
|
|
10
|
+
To learn more about the service, see the [Generative AI documentation](/iaas/Content/generative-ai/home.htm).
|
|
11
|
+
|
|
12
|
+
* OpenAPI spec version: 20231130
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* NOTE: This class is auto generated by OracleSDKGenerator.
|
|
16
|
+
* Do not edit the class manually.
|
|
17
|
+
*
|
|
18
|
+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
|
19
|
+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
|
20
|
+
*/
|
|
21
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.LlamaLlmInferenceResponse = void 0;
|
|
42
|
+
const model = __importStar(require("../model"));
|
|
43
|
+
var LlamaLlmInferenceResponse;
|
|
44
|
+
(function (LlamaLlmInferenceResponse) {
|
|
45
|
+
function getJsonObj(obj, isParentJsonObj) {
|
|
46
|
+
const jsonObj = Object.assign(Object.assign({}, (isParentJsonObj
|
|
47
|
+
? obj
|
|
48
|
+
: model.LlmInferenceResponse.getJsonObj(obj))), {
|
|
49
|
+
"choices": obj.choices
|
|
50
|
+
? obj.choices.map(item => {
|
|
51
|
+
return model.Choice.getJsonObj(item);
|
|
52
|
+
})
|
|
53
|
+
: undefined
|
|
54
|
+
});
|
|
55
|
+
return jsonObj;
|
|
56
|
+
}
|
|
57
|
+
LlamaLlmInferenceResponse.getJsonObj = getJsonObj;
|
|
58
|
+
LlamaLlmInferenceResponse.runtimeType = "LLAMA";
|
|
59
|
+
function getDeserializedJsonObj(obj, isParentJsonObj) {
|
|
60
|
+
const jsonObj = Object.assign(Object.assign({}, (isParentJsonObj
|
|
61
|
+
? obj
|
|
62
|
+
: model.LlmInferenceResponse.getDeserializedJsonObj(obj))), {
|
|
63
|
+
"choices": obj.choices
|
|
64
|
+
? obj.choices.map(item => {
|
|
65
|
+
return model.Choice.getDeserializedJsonObj(item);
|
|
66
|
+
})
|
|
67
|
+
: undefined
|
|
68
|
+
});
|
|
69
|
+
return jsonObj;
|
|
70
|
+
}
|
|
71
|
+
LlamaLlmInferenceResponse.getDeserializedJsonObj = getDeserializedJsonObj;
|
|
72
|
+
})(LlamaLlmInferenceResponse = exports.LlamaLlmInferenceResponse || (exports.LlamaLlmInferenceResponse = {}));
|
|
73
|
+
//# sourceMappingURL=llama-llm-inference-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llama-llm-inference-response.js","sourceRoot":"","sources":["../../../../../lib/generativeaiinference/lib/model/llama-llm-inference-response.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAkC;AAmBlC,IAAiB,yBAAyB,CAqCzC;AArCD,WAAiB,yBAAyB;IACxC,SAAgB,UAAU,CAAC,GAA8B,EAAE,eAAyB;QAClF,MAAM,OAAO,mCACR,CAAC,eAAe;YACjB,CAAC,CAAC,GAAG;YACL,CAAC,CAAE,KAAK,CAAC,oBAAoB,CAAC,UAAU,CAAC,GAAG,CAA+B,CAAC,GAC3E;YACD,SAAS,EAAE,GAAG,CAAC,OAAO;gBACpB,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBACrB,OAAO,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACvC,CAAC,CAAC;gBACJ,CAAC,CAAC,SAAS;SACd,CACF,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAfe,oCAAU,aAezB,CAAA;IACY,qCAAW,GAAG,OAAO,CAAC;IACnC,SAAgB,sBAAsB,CACpC,GAA8B,EAC9B,eAAyB;QAEzB,MAAM,OAAO,mCACR,CAAC,eAAe;YACjB,CAAC,CAAC,GAAG;YACL,CAAC,CAAE,KAAK,CAAC,oBAAoB,CAAC,sBAAsB,CAAC,GAAG,CAA+B,CAAC,GACvF;YACD,SAAS,EAAE,GAAG,CAAC,OAAO;gBACpB,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBACrB,OAAO,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;gBACnD,CAAC,CAAC;gBACJ,CAAC,CAAC,SAAS;SACd,CACF,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAlBe,gDAAsB,yBAkBrC,CAAA;AACH,CAAC,EArCgB,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAqCzC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generative AI Service Inference API
|
|
3
|
+
* OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings.
|
|
4
|
+
|
|
5
|
+
Use the Generative AI service inference API to access your custom model endpoints, or to try the out-of-the-box models to [generate text](#/en/generative-ai-inference/latest/GenerateTextResult/GenerateText), [summarize](#/en/generative-ai-inference/latest/SummarizeTextResult/SummarizeText), and [create text embeddings](#/en/generative-ai-inference/latest/EmbedTextResult/EmbedText).
|
|
6
|
+
|
|
7
|
+
To use a Generative AI custom model for inference, you must first create an endpoint for that model. Use the [Generative AI service management API](/#/en/generative-ai/latest/) to [create a custom model](#/en/generative-ai/latest/Model/) by fine-tuning an out-of-the-box model, or a previous version of a custom model, using your own data. Fine-tune the custom model on a [fine-tuning dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/). Then, create a [hosting dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/) with an [endpoint](#/en/generative-ai/latest/Endpoint/) to host your custom model. For resource management in the Generative AI service, use the [Generative AI service management API](/#/en/generative-ai/latest/).
|
|
8
|
+
|
|
9
|
+
To learn more about the service, see the [Generative AI documentation](/iaas/Content/generative-ai/home.htm).
|
|
10
|
+
|
|
11
|
+
* OpenAPI spec version: 20231130
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* NOTE: This class is auto generated by OracleSDKGenerator.
|
|
15
|
+
* Do not edit the class manually.
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
|
18
|
+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The base class for the inference requests.
|
|
22
|
+
*/
|
|
23
|
+
export interface LlmInferenceRequest {
|
|
24
|
+
"runtimeType": string;
|
|
25
|
+
}
|
|
26
|
+
export declare namespace LlmInferenceRequest {
|
|
27
|
+
function getJsonObj(obj: LlmInferenceRequest): object;
|
|
28
|
+
function getDeserializedJsonObj(obj: LlmInferenceRequest): object;
|
|
29
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generative AI Service Inference API
|
|
4
|
+
* OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings.
|
|
5
|
+
|
|
6
|
+
Use the Generative AI service inference API to access your custom model endpoints, or to try the out-of-the-box models to [generate text](#/en/generative-ai-inference/latest/GenerateTextResult/GenerateText), [summarize](#/en/generative-ai-inference/latest/SummarizeTextResult/SummarizeText), and [create text embeddings](#/en/generative-ai-inference/latest/EmbedTextResult/EmbedText).
|
|
7
|
+
|
|
8
|
+
To use a Generative AI custom model for inference, you must first create an endpoint for that model. Use the [Generative AI service management API](/#/en/generative-ai/latest/) to [create a custom model](#/en/generative-ai/latest/Model/) by fine-tuning an out-of-the-box model, or a previous version of a custom model, using your own data. Fine-tune the custom model on a [fine-tuning dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/). Then, create a [hosting dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/) with an [endpoint](#/en/generative-ai/latest/Endpoint/) to host your custom model. For resource management in the Generative AI service, use the [Generative AI service management API](/#/en/generative-ai/latest/).
|
|
9
|
+
|
|
10
|
+
To learn more about the service, see the [Generative AI documentation](/iaas/Content/generative-ai/home.htm).
|
|
11
|
+
|
|
12
|
+
* OpenAPI spec version: 20231130
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* NOTE: This class is auto generated by OracleSDKGenerator.
|
|
16
|
+
* Do not edit the class manually.
|
|
17
|
+
*
|
|
18
|
+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
|
19
|
+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
|
20
|
+
*/
|
|
21
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.LlmInferenceRequest = void 0;
|
|
42
|
+
const model = __importStar(require("../model"));
|
|
43
|
+
const common = require("oci-common");
|
|
44
|
+
var LlmInferenceRequest;
|
|
45
|
+
(function (LlmInferenceRequest) {
|
|
46
|
+
function getJsonObj(obj) {
|
|
47
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {});
|
|
48
|
+
if (obj && "runtimeType" in obj && obj.runtimeType) {
|
|
49
|
+
switch (obj.runtimeType) {
|
|
50
|
+
case "LLAMA":
|
|
51
|
+
return model.LlamaLlmInferenceRequest.getJsonObj(jsonObj, true);
|
|
52
|
+
case "COHERE":
|
|
53
|
+
return model.CohereLlmInferenceRequest.getJsonObj(jsonObj, true);
|
|
54
|
+
default:
|
|
55
|
+
if (common.LOG.logger)
|
|
56
|
+
common.LOG.logger.info(`Unknown value for: ${obj.runtimeType}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return jsonObj;
|
|
60
|
+
}
|
|
61
|
+
LlmInferenceRequest.getJsonObj = getJsonObj;
|
|
62
|
+
function getDeserializedJsonObj(obj) {
|
|
63
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {});
|
|
64
|
+
if (obj && "runtimeType" in obj && obj.runtimeType) {
|
|
65
|
+
switch (obj.runtimeType) {
|
|
66
|
+
case "LLAMA":
|
|
67
|
+
return model.LlamaLlmInferenceRequest.getDeserializedJsonObj(jsonObj, true);
|
|
68
|
+
case "COHERE":
|
|
69
|
+
return model.CohereLlmInferenceRequest.getDeserializedJsonObj(jsonObj, true);
|
|
70
|
+
default:
|
|
71
|
+
if (common.LOG.logger)
|
|
72
|
+
common.LOG.logger.info(`Unknown value for: ${obj.runtimeType}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return jsonObj;
|
|
76
|
+
}
|
|
77
|
+
LlmInferenceRequest.getDeserializedJsonObj = getDeserializedJsonObj;
|
|
78
|
+
})(LlmInferenceRequest = exports.LlmInferenceRequest || (exports.LlmInferenceRequest = {}));
|
|
79
|
+
//# sourceMappingURL=llm-inference-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-inference-request.js","sourceRoot":"","sources":["../../../../../lib/generativeaiinference/lib/model/llm-inference-request.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAkC;AAClC,qCAAsC;AAStC,IAAiB,mBAAmB,CA2CnC;AA3CD,WAAiB,mBAAmB;IAClC,SAAgB,UAAU,CAAC,GAAwB;QACjD,MAAM,OAAO,mCAAQ,GAAG,GAAK,EAAE,CAAE,CAAC;QAElC,IAAI,GAAG,IAAI,aAAa,IAAI,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE;YAClD,QAAQ,GAAG,CAAC,WAAW,EAAE;gBACvB,KAAK,OAAO;oBACV,OAAO,KAAK,CAAC,wBAAwB,CAAC,UAAU,CACL,OAAQ,EACjD,IAAI,CACL,CAAC;gBACJ,KAAK,QAAQ;oBACX,OAAO,KAAK,CAAC,yBAAyB,CAAC,UAAU,CACL,OAAQ,EAClD,IAAI,CACL,CAAC;gBACJ;oBACE,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM;wBAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;aAC1F;SACF;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IApBe,8BAAU,aAoBzB,CAAA;IACD,SAAgB,sBAAsB,CAAC,GAAwB;QAC7D,MAAM,OAAO,mCAAQ,GAAG,GAAK,EAAE,CAAE,CAAC;QAElC,IAAI,GAAG,IAAI,aAAa,IAAI,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE;YAClD,QAAQ,GAAG,CAAC,WAAW,EAAE;gBACvB,KAAK,OAAO;oBACV,OAAO,KAAK,CAAC,wBAAwB,CAAC,sBAAsB,CACjB,OAAQ,EACjD,IAAI,CACL,CAAC;gBACJ,KAAK,QAAQ;oBACX,OAAO,KAAK,CAAC,yBAAyB,CAAC,sBAAsB,CACjB,OAAQ,EAClD,IAAI,CACL,CAAC;gBACJ;oBACE,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM;wBAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;aAC1F;SACF;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IApBe,0CAAsB,yBAoBrC,CAAA;AACH,CAAC,EA3CgB,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QA2CnC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generative AI Service Inference API
|
|
3
|
+
* OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings.
|
|
4
|
+
|
|
5
|
+
Use the Generative AI service inference API to access your custom model endpoints, or to try the out-of-the-box models to [generate text](#/en/generative-ai-inference/latest/GenerateTextResult/GenerateText), [summarize](#/en/generative-ai-inference/latest/SummarizeTextResult/SummarizeText), and [create text embeddings](#/en/generative-ai-inference/latest/EmbedTextResult/EmbedText).
|
|
6
|
+
|
|
7
|
+
To use a Generative AI custom model for inference, you must first create an endpoint for that model. Use the [Generative AI service management API](/#/en/generative-ai/latest/) to [create a custom model](#/en/generative-ai/latest/Model/) by fine-tuning an out-of-the-box model, or a previous version of a custom model, using your own data. Fine-tune the custom model on a [fine-tuning dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/). Then, create a [hosting dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/) with an [endpoint](#/en/generative-ai/latest/Endpoint/) to host your custom model. For resource management in the Generative AI service, use the [Generative AI service management API](/#/en/generative-ai/latest/).
|
|
8
|
+
|
|
9
|
+
To learn more about the service, see the [Generative AI documentation](/iaas/Content/generative-ai/home.htm).
|
|
10
|
+
|
|
11
|
+
* OpenAPI spec version: 20231130
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* NOTE: This class is auto generated by OracleSDKGenerator.
|
|
15
|
+
* Do not edit the class manually.
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
|
18
|
+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The base class for inference responses.
|
|
22
|
+
*/
|
|
23
|
+
export interface LlmInferenceResponse {
|
|
24
|
+
"runtimeType": string;
|
|
25
|
+
}
|
|
26
|
+
export declare namespace LlmInferenceResponse {
|
|
27
|
+
function getJsonObj(obj: LlmInferenceResponse): object;
|
|
28
|
+
function getDeserializedJsonObj(obj: LlmInferenceResponse): object;
|
|
29
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generative AI Service Inference API
|
|
4
|
+
* OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings.
|
|
5
|
+
|
|
6
|
+
Use the Generative AI service inference API to access your custom model endpoints, or to try the out-of-the-box models to [generate text](#/en/generative-ai-inference/latest/GenerateTextResult/GenerateText), [summarize](#/en/generative-ai-inference/latest/SummarizeTextResult/SummarizeText), and [create text embeddings](#/en/generative-ai-inference/latest/EmbedTextResult/EmbedText).
|
|
7
|
+
|
|
8
|
+
To use a Generative AI custom model for inference, you must first create an endpoint for that model. Use the [Generative AI service management API](/#/en/generative-ai/latest/) to [create a custom model](#/en/generative-ai/latest/Model/) by fine-tuning an out-of-the-box model, or a previous version of a custom model, using your own data. Fine-tune the custom model on a [fine-tuning dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/). Then, create a [hosting dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/) with an [endpoint](#/en/generative-ai/latest/Endpoint/) to host your custom model. For resource management in the Generative AI service, use the [Generative AI service management API](/#/en/generative-ai/latest/).
|
|
9
|
+
|
|
10
|
+
To learn more about the service, see the [Generative AI documentation](/iaas/Content/generative-ai/home.htm).
|
|
11
|
+
|
|
12
|
+
* OpenAPI spec version: 20231130
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* NOTE: This class is auto generated by OracleSDKGenerator.
|
|
16
|
+
* Do not edit the class manually.
|
|
17
|
+
*
|
|
18
|
+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
|
19
|
+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
|
20
|
+
*/
|
|
21
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.LlmInferenceResponse = void 0;
|
|
42
|
+
const model = __importStar(require("../model"));
|
|
43
|
+
const common = require("oci-common");
|
|
44
|
+
var LlmInferenceResponse;
|
|
45
|
+
(function (LlmInferenceResponse) {
|
|
46
|
+
function getJsonObj(obj) {
|
|
47
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {});
|
|
48
|
+
if (obj && "runtimeType" in obj && obj.runtimeType) {
|
|
49
|
+
switch (obj.runtimeType) {
|
|
50
|
+
case "LLAMA":
|
|
51
|
+
return model.LlamaLlmInferenceResponse.getJsonObj(jsonObj, true);
|
|
52
|
+
case "COHERE":
|
|
53
|
+
return model.CohereLlmInferenceResponse.getJsonObj(jsonObj, true);
|
|
54
|
+
default:
|
|
55
|
+
if (common.LOG.logger)
|
|
56
|
+
common.LOG.logger.info(`Unknown value for: ${obj.runtimeType}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return jsonObj;
|
|
60
|
+
}
|
|
61
|
+
LlmInferenceResponse.getJsonObj = getJsonObj;
|
|
62
|
+
function getDeserializedJsonObj(obj) {
|
|
63
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {});
|
|
64
|
+
if (obj && "runtimeType" in obj && obj.runtimeType) {
|
|
65
|
+
switch (obj.runtimeType) {
|
|
66
|
+
case "LLAMA":
|
|
67
|
+
return model.LlamaLlmInferenceResponse.getDeserializedJsonObj(jsonObj, true);
|
|
68
|
+
case "COHERE":
|
|
69
|
+
return model.CohereLlmInferenceResponse.getDeserializedJsonObj(jsonObj, true);
|
|
70
|
+
default:
|
|
71
|
+
if (common.LOG.logger)
|
|
72
|
+
common.LOG.logger.info(`Unknown value for: ${obj.runtimeType}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return jsonObj;
|
|
76
|
+
}
|
|
77
|
+
LlmInferenceResponse.getDeserializedJsonObj = getDeserializedJsonObj;
|
|
78
|
+
})(LlmInferenceResponse = exports.LlmInferenceResponse || (exports.LlmInferenceResponse = {}));
|
|
79
|
+
//# sourceMappingURL=llm-inference-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-inference-response.js","sourceRoot":"","sources":["../../../../../lib/generativeaiinference/lib/model/llm-inference-response.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAkC;AAClC,qCAAsC;AAStC,IAAiB,oBAAoB,CA2CpC;AA3CD,WAAiB,oBAAoB;IACnC,SAAgB,UAAU,CAAC,GAAyB;QAClD,MAAM,OAAO,mCAAQ,GAAG,GAAK,EAAE,CAAE,CAAC;QAElC,IAAI,GAAG,IAAI,aAAa,IAAI,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE;YAClD,QAAQ,GAAG,CAAC,WAAW,EAAE;gBACvB,KAAK,OAAO;oBACV,OAAO,KAAK,CAAC,yBAAyB,CAAC,UAAU,CACL,OAAQ,EAClD,IAAI,CACL,CAAC;gBACJ,KAAK,QAAQ;oBACX,OAAO,KAAK,CAAC,0BAA0B,CAAC,UAAU,CACL,OAAQ,EACnD,IAAI,CACL,CAAC;gBACJ;oBACE,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM;wBAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;aAC1F;SACF;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IApBe,+BAAU,aAoBzB,CAAA;IACD,SAAgB,sBAAsB,CAAC,GAAyB;QAC9D,MAAM,OAAO,mCAAQ,GAAG,GAAK,EAAE,CAAE,CAAC;QAElC,IAAI,GAAG,IAAI,aAAa,IAAI,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE;YAClD,QAAQ,GAAG,CAAC,WAAW,EAAE;gBACvB,KAAK,OAAO;oBACV,OAAO,KAAK,CAAC,yBAAyB,CAAC,sBAAsB,CACjB,OAAQ,EAClD,IAAI,CACL,CAAC;gBACJ,KAAK,QAAQ;oBACX,OAAO,KAAK,CAAC,0BAA0B,CAAC,sBAAsB,CACjB,OAAQ,EACnD,IAAI,CACL,CAAC;gBACJ;oBACE,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM;wBAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;aAC1F;SACF;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IApBe,2CAAsB,yBAoBrC,CAAA;AACH,CAAC,EA3CgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QA2CpC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generative AI Service Inference API
|
|
3
|
+
* OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings.
|
|
4
|
+
|
|
5
|
+
Use the Generative AI service inference API to access your custom model endpoints, or to try the out-of-the-box models to [generate text](#/en/generative-ai-inference/latest/GenerateTextResult/GenerateText), [summarize](#/en/generative-ai-inference/latest/SummarizeTextResult/SummarizeText), and [create text embeddings](#/en/generative-ai-inference/latest/EmbedTextResult/EmbedText).
|
|
6
|
+
|
|
7
|
+
To use a Generative AI custom model for inference, you must first create an endpoint for that model. Use the [Generative AI service management API](/#/en/generative-ai/latest/) to [create a custom model](#/en/generative-ai/latest/Model/) by fine-tuning an out-of-the-box model, or a previous version of a custom model, using your own data. Fine-tune the custom model on a [fine-tuning dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/). Then, create a [hosting dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/) with an [endpoint](#/en/generative-ai/latest/Endpoint/) to host your custom model. For resource management in the Generative AI service, use the [Generative AI service management API](/#/en/generative-ai/latest/).
|
|
8
|
+
|
|
9
|
+
To learn more about the service, see the [Generative AI documentation](/iaas/Content/generative-ai/home.htm).
|
|
10
|
+
|
|
11
|
+
* OpenAPI spec version: 20231130
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* NOTE: This class is auto generated by OracleSDKGenerator.
|
|
15
|
+
* Do not edit the class manually.
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
|
18
|
+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Returns if the logarithmic probabilites is set.
|
|
22
|
+
*/
|
|
23
|
+
export interface Logprobs {
|
|
24
|
+
/**
|
|
25
|
+
* The text offset.
|
|
26
|
+
*/
|
|
27
|
+
"textOffset"?: Array<number>;
|
|
28
|
+
/**
|
|
29
|
+
* The logarithmic probabilites of the output token.
|
|
30
|
+
*/
|
|
31
|
+
"tokenLogprobs"?: Array<number>;
|
|
32
|
+
/**
|
|
33
|
+
* The list of output tokens.
|
|
34
|
+
*/
|
|
35
|
+
"tokens"?: Array<string>;
|
|
36
|
+
/**
|
|
37
|
+
* The logarithmic probabilities of each of the top k tokens.
|
|
38
|
+
*/
|
|
39
|
+
"topLogprobs"?: Array<{
|
|
40
|
+
[key: string]: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
export declare namespace Logprobs {
|
|
44
|
+
function getJsonObj(obj: Logprobs): object;
|
|
45
|
+
function getDeserializedJsonObj(obj: Logprobs): object;
|
|
46
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generative AI Service Inference API
|
|
4
|
+
* OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings.
|
|
5
|
+
|
|
6
|
+
Use the Generative AI service inference API to access your custom model endpoints, or to try the out-of-the-box models to [generate text](#/en/generative-ai-inference/latest/GenerateTextResult/GenerateText), [summarize](#/en/generative-ai-inference/latest/SummarizeTextResult/SummarizeText), and [create text embeddings](#/en/generative-ai-inference/latest/EmbedTextResult/EmbedText).
|
|
7
|
+
|
|
8
|
+
To use a Generative AI custom model for inference, you must first create an endpoint for that model. Use the [Generative AI service management API](/#/en/generative-ai/latest/) to [create a custom model](#/en/generative-ai/latest/Model/) by fine-tuning an out-of-the-box model, or a previous version of a custom model, using your own data. Fine-tune the custom model on a [fine-tuning dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/). Then, create a [hosting dedicated AI cluster](#/en/generative-ai/latest/DedicatedAiCluster/) with an [endpoint](#/en/generative-ai/latest/Endpoint/) to host your custom model. For resource management in the Generative AI service, use the [Generative AI service management API](/#/en/generative-ai/latest/).
|
|
9
|
+
|
|
10
|
+
To learn more about the service, see the [Generative AI documentation](/iaas/Content/generative-ai/home.htm).
|
|
11
|
+
|
|
12
|
+
* OpenAPI spec version: 20231130
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* NOTE: This class is auto generated by OracleSDKGenerator.
|
|
16
|
+
* Do not edit the class manually.
|
|
17
|
+
*
|
|
18
|
+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
|
|
19
|
+
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.Logprobs = void 0;
|
|
23
|
+
var Logprobs;
|
|
24
|
+
(function (Logprobs) {
|
|
25
|
+
function getJsonObj(obj) {
|
|
26
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {});
|
|
27
|
+
return jsonObj;
|
|
28
|
+
}
|
|
29
|
+
Logprobs.getJsonObj = getJsonObj;
|
|
30
|
+
function getDeserializedJsonObj(obj) {
|
|
31
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {});
|
|
32
|
+
return jsonObj;
|
|
33
|
+
}
|
|
34
|
+
Logprobs.getDeserializedJsonObj = getDeserializedJsonObj;
|
|
35
|
+
})(Logprobs = exports.Logprobs || (exports.Logprobs = {}));
|
|
36
|
+
//# sourceMappingURL=logprobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logprobs.js","sourceRoot":"","sources":["../../../../../lib/generativeaiinference/lib/model/logprobs.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AA2BH,IAAiB,QAAQ,CAWxB;AAXD,WAAiB,QAAQ;IACvB,SAAgB,UAAU,CAAC,GAAa;QACtC,MAAM,OAAO,mCAAQ,GAAG,GAAK,EAAE,CAAE,CAAC;QAElC,OAAO,OAAO,CAAC;IACjB,CAAC;IAJe,mBAAU,aAIzB,CAAA;IACD,SAAgB,sBAAsB,CAAC,GAAa;QAClD,MAAM,OAAO,mCAAQ,GAAG,GAAK,EAAE,CAAE,CAAC;QAElC,OAAO,OAAO,CAAC;IACjB,CAAC;IAJe,+BAAsB,yBAIrC,CAAA;AACH,CAAC,EAXgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAWxB"}
|