oci-generativeaiinference 2.84.0 → 2.85.0
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/lib/client.d.ts +17 -3
- package/lib/client.js +78 -3
- package/lib/client.js.map +1 -1
- package/lib/model/base-chat-request.d.ts +29 -0
- package/lib/model/base-chat-request.js +79 -0
- package/lib/model/base-chat-request.js.map +1 -0
- package/lib/model/base-chat-response.d.ts +29 -0
- package/lib/model/base-chat-response.js +79 -0
- package/lib/model/base-chat-response.js.map +1 -0
- package/lib/model/chat-choice.d.ts +42 -0
- package/lib/model/chat-choice.js +62 -0
- package/lib/model/chat-choice.js.map +1 -0
- package/lib/model/chat-content.d.ts +29 -0
- package/lib/model/chat-content.js +75 -0
- package/lib/model/chat-content.js.map +1 -0
- package/lib/model/chat-details.d.ts +35 -0
- package/lib/model/chat-details.js +68 -0
- package/lib/model/chat-details.js.map +1 -0
- package/lib/model/chat-result.d.ts +38 -0
- package/lib/model/chat-result.js +64 -0
- package/lib/model/chat-result.js.map +1 -0
- package/lib/model/citation.d.ts +44 -0
- package/lib/model/citation.js +36 -0
- package/lib/model/citation.js.map +1 -0
- package/lib/model/cohere-chat-request.d.ts +95 -0
- package/lib/model/cohere-chat-request.js +71 -0
- package/lib/model/cohere-chat-request.js.map +1 -0
- package/lib/model/cohere-chat-response.d.ts +70 -0
- package/lib/model/cohere-chat-response.js +95 -0
- package/lib/model/cohere-chat-response.js.map +1 -0
- package/lib/model/cohere-message.d.ts +40 -0
- package/lib/model/cohere-message.js +41 -0
- package/lib/model/cohere-message.js.map +1 -0
- package/lib/model/embed-text-details.d.ts +1 -1
- package/lib/model/generic-chat-request.d.ts +98 -0
- package/lib/model/generic-chat-request.js +71 -0
- package/lib/model/generic-chat-request.js.map +1 -0
- package/lib/model/generic-chat-response.d.ts +39 -0
- package/lib/model/generic-chat-response.js +71 -0
- package/lib/model/generic-chat-response.js.map +1 -0
- package/lib/model/index.d.ts +30 -0
- package/lib/model/index.js +31 -1
- package/lib/model/index.js.map +1 -1
- package/lib/model/llama-llm-inference-request.d.ts +1 -1
- package/lib/model/message.d.ts +37 -0
- package/lib/model/message.js +68 -0
- package/lib/model/message.js.map +1 -0
- package/lib/model/search-query.d.ts +32 -0
- package/lib/model/search-query.js +36 -0
- package/lib/model/search-query.js.map +1 -0
- package/lib/model/text-content.d.ts +35 -0
- package/lib/model/text-content.js +57 -0
- package/lib/model/text-content.js.map +1 -0
- package/lib/request/chat-request.d.ts +36 -0
- package/lib/request/chat-request.js +15 -0
- package/lib/request/chat-request.js.map +1 -0
- package/lib/request/embed-text-request.d.ts +1 -1
- package/lib/request/generate-text-request.d.ts +1 -1
- package/lib/request/index.d.ts +2 -0
- package/lib/request/summarize-text-request.d.ts +1 -1
- package/lib/response/chat-response.d.ts +30 -0
- package/lib/response/chat-response.js +15 -0
- package/lib/response/chat-response.js.map +1 -0
- package/lib/response/index.d.ts +2 -0
- package/package.json +3 -3
|
@@ -0,0 +1,75 @@
|
|
|
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.ChatContent = void 0;
|
|
42
|
+
const model = __importStar(require("../model"));
|
|
43
|
+
const common = require("oci-common");
|
|
44
|
+
var ChatContent;
|
|
45
|
+
(function (ChatContent) {
|
|
46
|
+
function getJsonObj(obj) {
|
|
47
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {});
|
|
48
|
+
if (obj && "type" in obj && obj.type) {
|
|
49
|
+
switch (obj.type) {
|
|
50
|
+
case "TEXT":
|
|
51
|
+
return model.TextContent.getJsonObj(jsonObj, true);
|
|
52
|
+
default:
|
|
53
|
+
if (common.LOG.logger)
|
|
54
|
+
common.LOG.logger.info(`Unknown value for: ${obj.type}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return jsonObj;
|
|
58
|
+
}
|
|
59
|
+
ChatContent.getJsonObj = getJsonObj;
|
|
60
|
+
function getDeserializedJsonObj(obj) {
|
|
61
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {});
|
|
62
|
+
if (obj && "type" in obj && obj.type) {
|
|
63
|
+
switch (obj.type) {
|
|
64
|
+
case "TEXT":
|
|
65
|
+
return model.TextContent.getDeserializedJsonObj(jsonObj, true);
|
|
66
|
+
default:
|
|
67
|
+
if (common.LOG.logger)
|
|
68
|
+
common.LOG.logger.info(`Unknown value for: ${obj.type}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return jsonObj;
|
|
72
|
+
}
|
|
73
|
+
ChatContent.getDeserializedJsonObj = getDeserializedJsonObj;
|
|
74
|
+
})(ChatContent = exports.ChatContent || (exports.ChatContent = {}));
|
|
75
|
+
//# sourceMappingURL=chat-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-content.js","sourceRoot":"","sources":["../../../../../lib/generativeaiinference/lib/model/chat-content.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAkC;AAClC,qCAAsC;AAStC,IAAiB,WAAW,CA8B3B;AA9BD,WAAiB,WAAW;IAC1B,SAAgB,UAAU,CAAC,GAAgB;QACzC,MAAM,OAAO,mCAAQ,GAAG,GAAK,EAAE,CAAE,CAAC;QAElC,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE;YACpC,QAAQ,GAAG,CAAC,IAAI,EAAE;gBAChB,KAAK,MAAM;oBACT,OAAO,KAAK,CAAC,WAAW,CAAC,UAAU,CAA6B,OAAQ,EAAE,IAAI,CAAC,CAAC;gBAClF;oBACE,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM;wBAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;aACnF;SACF;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAZe,sBAAU,aAYzB,CAAA;IACD,SAAgB,sBAAsB,CAAC,GAAgB;QACrD,MAAM,OAAO,mCAAQ,GAAG,GAAK,EAAE,CAAE,CAAC;QAElC,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE;YACpC,QAAQ,GAAG,CAAC,IAAI,EAAE;gBAChB,KAAK,MAAM;oBACT,OAAO,KAAK,CAAC,WAAW,CAAC,sBAAsB,CACjB,OAAQ,EACpC,IAAI,CACL,CAAC;gBACJ;oBACE,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM;wBAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;aACnF;SACF;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAfe,kCAAsB,yBAerC,CAAA;AACH,CAAC,EA9BgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA8B3B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 of the conversation for the model to respond.
|
|
23
|
+
*/
|
|
24
|
+
export interface ChatDetails {
|
|
25
|
+
/**
|
|
26
|
+
* The OCID of compartment that the user is authorized to use to call into the Generative AI service.
|
|
27
|
+
*/
|
|
28
|
+
"compartmentId": string;
|
|
29
|
+
"servingMode": model.DedicatedServingMode | model.OnDemandServingMode;
|
|
30
|
+
"chatRequest"?: model.GenericChatRequest | model.CohereChatRequest;
|
|
31
|
+
}
|
|
32
|
+
export declare namespace ChatDetails {
|
|
33
|
+
function getJsonObj(obj: ChatDetails): object;
|
|
34
|
+
function getDeserializedJsonObj(obj: ChatDetails): object;
|
|
35
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.ChatDetails = void 0;
|
|
42
|
+
const model = __importStar(require("../model"));
|
|
43
|
+
var ChatDetails;
|
|
44
|
+
(function (ChatDetails) {
|
|
45
|
+
function getJsonObj(obj) {
|
|
46
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {
|
|
47
|
+
"servingMode": obj.servingMode ? model.ServingMode.getJsonObj(obj.servingMode) : undefined,
|
|
48
|
+
"chatRequest": obj.chatRequest
|
|
49
|
+
? model.BaseChatRequest.getJsonObj(obj.chatRequest)
|
|
50
|
+
: undefined
|
|
51
|
+
});
|
|
52
|
+
return jsonObj;
|
|
53
|
+
}
|
|
54
|
+
ChatDetails.getJsonObj = getJsonObj;
|
|
55
|
+
function getDeserializedJsonObj(obj) {
|
|
56
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {
|
|
57
|
+
"servingMode": obj.servingMode
|
|
58
|
+
? model.ServingMode.getDeserializedJsonObj(obj.servingMode)
|
|
59
|
+
: undefined,
|
|
60
|
+
"chatRequest": obj.chatRequest
|
|
61
|
+
? model.BaseChatRequest.getDeserializedJsonObj(obj.chatRequest)
|
|
62
|
+
: undefined
|
|
63
|
+
});
|
|
64
|
+
return jsonObj;
|
|
65
|
+
}
|
|
66
|
+
ChatDetails.getDeserializedJsonObj = getDeserializedJsonObj;
|
|
67
|
+
})(ChatDetails = exports.ChatDetails || (exports.ChatDetails = {}));
|
|
68
|
+
//# sourceMappingURL=chat-details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-details.js","sourceRoot":"","sources":["../../../../../lib/generativeaiinference/lib/model/chat-details.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAkC;AAelC,IAAiB,WAAW,CA6B3B;AA7BD,WAAiB,WAAW;IAC1B,SAAgB,UAAU,CAAC,GAAgB;QACzC,MAAM,OAAO,mCACR,GAAG,GACH;YACD,aAAa,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;YAC1F,aAAa,EAAE,GAAG,CAAC,WAAW;gBAC5B,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC;gBACnD,CAAC,CAAC,SAAS;SACd,CACF,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAZe,sBAAU,aAYzB,CAAA;IACD,SAAgB,sBAAsB,CAAC,GAAgB;QACrD,MAAM,OAAO,mCACR,GAAG,GACH;YACD,aAAa,EAAE,GAAG,CAAC,WAAW;gBAC5B,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,sBAAsB,CAAC,GAAG,CAAC,WAAW,CAAC;gBAC3D,CAAC,CAAC,SAAS;YACb,aAAa,EAAE,GAAG,CAAC,WAAW;gBAC5B,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,WAAW,CAAC;gBAC/D,CAAC,CAAC,SAAS;SACd,CACF,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAde,kCAAsB,yBAcrC,CAAA;AACH,CAAC,EA7BgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA6B3B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 response to the chat conversation.
|
|
23
|
+
*/
|
|
24
|
+
export interface ChatResult {
|
|
25
|
+
/**
|
|
26
|
+
* The OCID of the model used in this inference request.
|
|
27
|
+
*/
|
|
28
|
+
"modelId": string;
|
|
29
|
+
/**
|
|
30
|
+
* The version of the model.
|
|
31
|
+
*/
|
|
32
|
+
"modelVersion": string;
|
|
33
|
+
"chatResponse": model.GenericChatResponse | model.CohereChatResponse;
|
|
34
|
+
}
|
|
35
|
+
export declare namespace ChatResult {
|
|
36
|
+
function getJsonObj(obj: ChatResult): object;
|
|
37
|
+
function getDeserializedJsonObj(obj: ChatResult): object;
|
|
38
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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.ChatResult = void 0;
|
|
42
|
+
const model = __importStar(require("../model"));
|
|
43
|
+
var ChatResult;
|
|
44
|
+
(function (ChatResult) {
|
|
45
|
+
function getJsonObj(obj) {
|
|
46
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {
|
|
47
|
+
"chatResponse": obj.chatResponse
|
|
48
|
+
? model.BaseChatResponse.getJsonObj(obj.chatResponse)
|
|
49
|
+
: undefined
|
|
50
|
+
});
|
|
51
|
+
return jsonObj;
|
|
52
|
+
}
|
|
53
|
+
ChatResult.getJsonObj = getJsonObj;
|
|
54
|
+
function getDeserializedJsonObj(obj) {
|
|
55
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {
|
|
56
|
+
"chatResponse": obj.chatResponse
|
|
57
|
+
? model.BaseChatResponse.getDeserializedJsonObj(obj.chatResponse)
|
|
58
|
+
: undefined
|
|
59
|
+
});
|
|
60
|
+
return jsonObj;
|
|
61
|
+
}
|
|
62
|
+
ChatResult.getDeserializedJsonObj = getDeserializedJsonObj;
|
|
63
|
+
})(ChatResult = exports.ChatResult || (exports.ChatResult = {}));
|
|
64
|
+
//# sourceMappingURL=chat-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-result.js","sourceRoot":"","sources":["../../../../../lib/generativeaiinference/lib/model/chat-result.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAkC;AAkBlC,IAAiB,UAAU,CAyB1B;AAzBD,WAAiB,UAAU;IACzB,SAAgB,UAAU,CAAC,GAAe;QACxC,MAAM,OAAO,mCACR,GAAG,GACH;YACD,cAAc,EAAE,GAAG,CAAC,YAAY;gBAC9B,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC;gBACrD,CAAC,CAAC,SAAS;SACd,CACF,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAXe,qBAAU,aAWzB,CAAA;IACD,SAAgB,sBAAsB,CAAC,GAAe;QACpD,MAAM,OAAO,mCACR,GAAG,GACH;YACD,cAAc,EAAE,GAAG,CAAC,YAAY;gBAC9B,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,GAAG,CAAC,YAAY,CAAC;gBACjE,CAAC,CAAC,SAAS;SACd,CACF,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAXe,iCAAsB,yBAWrC,CAAA;AACH,CAAC,EAzBgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAyB1B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
* A section of the generated reply which cites external knowledge.
|
|
22
|
+
*/
|
|
23
|
+
export interface Citation {
|
|
24
|
+
/**
|
|
25
|
+
* The index of text that the citation starts at, counting from zero. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
26
|
+
*/
|
|
27
|
+
"start": number;
|
|
28
|
+
/**
|
|
29
|
+
* The index of text that the citation ends after, counting from zero. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
30
|
+
*/
|
|
31
|
+
"end": number;
|
|
32
|
+
/**
|
|
33
|
+
* The text of the citation
|
|
34
|
+
*/
|
|
35
|
+
"text": string;
|
|
36
|
+
/**
|
|
37
|
+
* Identifiers of documents cited by this section of the generated reply.
|
|
38
|
+
*/
|
|
39
|
+
"documentIds": Array<string>;
|
|
40
|
+
}
|
|
41
|
+
export declare namespace Citation {
|
|
42
|
+
function getJsonObj(obj: Citation): object;
|
|
43
|
+
function getDeserializedJsonObj(obj: Citation): object;
|
|
44
|
+
}
|
|
@@ -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.Citation = void 0;
|
|
23
|
+
var Citation;
|
|
24
|
+
(function (Citation) {
|
|
25
|
+
function getJsonObj(obj) {
|
|
26
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {});
|
|
27
|
+
return jsonObj;
|
|
28
|
+
}
|
|
29
|
+
Citation.getJsonObj = getJsonObj;
|
|
30
|
+
function getDeserializedJsonObj(obj) {
|
|
31
|
+
const jsonObj = Object.assign(Object.assign({}, obj), {});
|
|
32
|
+
return jsonObj;
|
|
33
|
+
}
|
|
34
|
+
Citation.getDeserializedJsonObj = getDeserializedJsonObj;
|
|
35
|
+
})(Citation = exports.Citation || (exports.Citation = {}));
|
|
36
|
+
//# sourceMappingURL=citation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citation.js","sourceRoot":"","sources":["../../../../../lib/generativeaiinference/lib/model/citation.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"}
|
|
@@ -0,0 +1,95 @@
|
|
|
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 chat request for Cohere models.
|
|
23
|
+
*/
|
|
24
|
+
export interface CohereChatRequest extends model.BaseChatRequest {
|
|
25
|
+
/**
|
|
26
|
+
* Text input for the model to respond to.
|
|
27
|
+
*/
|
|
28
|
+
"message": string;
|
|
29
|
+
/**
|
|
30
|
+
* A list of previous messages between the user and the model, meant to give the model conversational context for responding to the user's message.
|
|
31
|
+
*/
|
|
32
|
+
"chatHistory"?: Array<model.CohereMessage>;
|
|
33
|
+
/**
|
|
34
|
+
* list of relevant documents that the model can cite to generate a more accurate reply.
|
|
35
|
+
* Some suggested keys are \"text\", \"author\", and \"date\". For better generation quality, it is
|
|
36
|
+
* recommended to keep the total word count of the strings in the dictionary to under 300
|
|
37
|
+
* words.
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
"documents"?: Array<any>;
|
|
41
|
+
/**
|
|
42
|
+
* When true, the response will only contain a list of generated search queries, but no search will take place, and no reply from the model to the user's message will be generated.
|
|
43
|
+
*/
|
|
44
|
+
"isSearchQueriesOnly"?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* When specified, the default Cohere preamble will be replaced with the provided one. Preambles are a part of the prompt used to adjust the model's overall behavior and conversation style. Default preambles vary for different models.
|
|
47
|
+
*/
|
|
48
|
+
"preambleOverride"?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to stream back partial progress. If set, tokens are sent as data-only server-sent events as they become available.
|
|
51
|
+
*/
|
|
52
|
+
"isStream"?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* 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.
|
|
55
|
+
*/
|
|
56
|
+
"maxTokens"?: number;
|
|
57
|
+
/**
|
|
58
|
+
* A number that sets the randomness of the generated output. A lower temperature means a less random generations.
|
|
59
|
+
* 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.
|
|
60
|
+
* Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
61
|
+
*/
|
|
62
|
+
"temperature"?: number;
|
|
63
|
+
/**
|
|
64
|
+
* 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 0 which disables this method and considers all tokens. To set a number for the likely tokens, choose an integer between 1 and 500.
|
|
65
|
+
* <p>
|
|
66
|
+
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.
|
|
67
|
+
* Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
68
|
+
*/
|
|
69
|
+
"topK"?: number;
|
|
70
|
+
/**
|
|
71
|
+
* 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.
|
|
72
|
+
* <p>
|
|
73
|
+
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.0 to consider all tokens and set to 0 to disable. If both k and p are enabled, p acts after k.
|
|
74
|
+
* Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
75
|
+
*/
|
|
76
|
+
"topP"?: number;
|
|
77
|
+
/**
|
|
78
|
+
* To reduce repetitiveness of generated tokens, this number penalizes new tokens based on their frequency in the generated text so far. Greater numbers encourage the model to use new tokens, while lower numbers encourage the model to repeat the tokens. Set to 0 to disable.
|
|
79
|
+
* Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
80
|
+
*/
|
|
81
|
+
"frequencyPenalty"?: number;
|
|
82
|
+
/**
|
|
83
|
+
* To reduce repetitiveness of generated tokens, this number penalizes new tokens based on whether they've appeared in the generated text so far. Greater numbers encourage the model to use new tokens, while lower numbers encourage the model to repeat the tokens.
|
|
84
|
+
* <p>
|
|
85
|
+
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.
|
|
86
|
+
* Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.
|
|
87
|
+
*/
|
|
88
|
+
"presencePenalty"?: number;
|
|
89
|
+
"apiFormat": string;
|
|
90
|
+
}
|
|
91
|
+
export declare namespace CohereChatRequest {
|
|
92
|
+
function getJsonObj(obj: CohereChatRequest, isParentJsonObj?: boolean): object;
|
|
93
|
+
const apiFormat = "COHERE";
|
|
94
|
+
function getDeserializedJsonObj(obj: CohereChatRequest, isParentJsonObj?: boolean): object;
|
|
95
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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.CohereChatRequest = void 0;
|
|
42
|
+
const model = __importStar(require("../model"));
|
|
43
|
+
var CohereChatRequest;
|
|
44
|
+
(function (CohereChatRequest) {
|
|
45
|
+
function getJsonObj(obj, isParentJsonObj) {
|
|
46
|
+
const jsonObj = Object.assign(Object.assign({}, (isParentJsonObj ? obj : model.BaseChatRequest.getJsonObj(obj))), {
|
|
47
|
+
"chatHistory": obj.chatHistory
|
|
48
|
+
? obj.chatHistory.map(item => {
|
|
49
|
+
return model.CohereMessage.getJsonObj(item);
|
|
50
|
+
})
|
|
51
|
+
: undefined
|
|
52
|
+
});
|
|
53
|
+
return jsonObj;
|
|
54
|
+
}
|
|
55
|
+
CohereChatRequest.getJsonObj = getJsonObj;
|
|
56
|
+
CohereChatRequest.apiFormat = "COHERE";
|
|
57
|
+
function getDeserializedJsonObj(obj, isParentJsonObj) {
|
|
58
|
+
const jsonObj = Object.assign(Object.assign({}, (isParentJsonObj
|
|
59
|
+
? obj
|
|
60
|
+
: model.BaseChatRequest.getDeserializedJsonObj(obj))), {
|
|
61
|
+
"chatHistory": obj.chatHistory
|
|
62
|
+
? obj.chatHistory.map(item => {
|
|
63
|
+
return model.CohereMessage.getDeserializedJsonObj(item);
|
|
64
|
+
})
|
|
65
|
+
: undefined
|
|
66
|
+
});
|
|
67
|
+
return jsonObj;
|
|
68
|
+
}
|
|
69
|
+
CohereChatRequest.getDeserializedJsonObj = getDeserializedJsonObj;
|
|
70
|
+
})(CohereChatRequest = exports.CohereChatRequest || (exports.CohereChatRequest = {}));
|
|
71
|
+
//# sourceMappingURL=cohere-chat-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohere-chat-request.js","sourceRoot":"","sources":["../../../../../lib/generativeaiinference/lib/model/cohere-chat-request.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAkC;AA2ElC,IAAiB,iBAAiB,CAmCjC;AAnCD,WAAiB,iBAAiB;IAChC,SAAgB,UAAU,CAAC,GAAsB,EAAE,eAAyB;QAC1E,MAAM,OAAO,mCACR,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAE,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,CAAuB,CAAC,GACtF;YACD,aAAa,EAAE,GAAG,CAAC,WAAW;gBAC5B,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBACzB,OAAO,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBAC9C,CAAC,CAAC;gBACJ,CAAC,CAAC,SAAS;SACd,CACF,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAbe,4BAAU,aAazB,CAAA;IACY,2BAAS,GAAG,QAAQ,CAAC;IAClC,SAAgB,sBAAsB,CACpC,GAAsB,EACtB,eAAyB;QAEzB,MAAM,OAAO,mCACR,CAAC,eAAe;YACjB,CAAC,CAAC,GAAG;YACL,CAAC,CAAE,KAAK,CAAC,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAuB,CAAC,GAC1E;YACD,aAAa,EAAE,GAAG,CAAC,WAAW;gBAC5B,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;oBACzB,OAAO,KAAK,CAAC,aAAa,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;gBAC1D,CAAC,CAAC;gBACJ,CAAC,CAAC,SAAS;SACd,CACF,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAlBe,wCAAsB,yBAkBrC,CAAA;AACH,CAAC,EAnCgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAmCjC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
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 response to the chat conversation.
|
|
23
|
+
*/
|
|
24
|
+
export interface CohereChatResponse extends model.BaseChatResponse {
|
|
25
|
+
/**
|
|
26
|
+
* Contents of the reply generated by the model.
|
|
27
|
+
*/
|
|
28
|
+
"text": string;
|
|
29
|
+
/**
|
|
30
|
+
* Inline citations for the generated reply.
|
|
31
|
+
*/
|
|
32
|
+
"citations"?: Array<model.Citation>;
|
|
33
|
+
/**
|
|
34
|
+
* Denotes that a search for documents is required.
|
|
35
|
+
*/
|
|
36
|
+
"isSearchRequired"?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Why the generation was completed.
|
|
39
|
+
*/
|
|
40
|
+
"finishReason": CohereChatResponse.FinishReason;
|
|
41
|
+
/**
|
|
42
|
+
* Generated search queries.
|
|
43
|
+
*/
|
|
44
|
+
"searchQueries"?: Array<model.SearchQuery>;
|
|
45
|
+
/**
|
|
46
|
+
* Documents seen by the model when generating the reply. Each document is a JSON String
|
|
47
|
+
* representing the field and values of the document.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
"documents"?: Array<any>;
|
|
51
|
+
"apiFormat": string;
|
|
52
|
+
}
|
|
53
|
+
export declare namespace CohereChatResponse {
|
|
54
|
+
enum FinishReason {
|
|
55
|
+
Complete = "COMPLETE",
|
|
56
|
+
ErrorToxic = "ERROR_TOXIC",
|
|
57
|
+
ErrorLimit = "ERROR_LIMIT",
|
|
58
|
+
Error = "ERROR",
|
|
59
|
+
UserCancel = "USER_CANCEL",
|
|
60
|
+
MaxTokens = "MAX_TOKENS",
|
|
61
|
+
/**
|
|
62
|
+
* This value is used if a service returns a value for this enum that is not recognized by this
|
|
63
|
+
* version of the SDK.
|
|
64
|
+
*/
|
|
65
|
+
UnknownValue = "UNKNOWN_VALUE"
|
|
66
|
+
}
|
|
67
|
+
function getJsonObj(obj: CohereChatResponse, isParentJsonObj?: boolean): object;
|
|
68
|
+
const apiFormat = "COHERE";
|
|
69
|
+
function getDeserializedJsonObj(obj: CohereChatResponse, isParentJsonObj?: boolean): object;
|
|
70
|
+
}
|