Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions core/llm/llms/oca/Oca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
} from "../../openaiTypeConverters.js";
import { OcaTokenManager } from "./util/ocaTokenManager.js";
import { createOcaHeaders, generateOpcRequestId } from "./util/utils.js";
import { DEFAULT_OCA_BASE_URL } from "./util/constants.js";

interface ModelInfoMap {
models: { [key: string]: ModelInfo };
Expand Down Expand Up @@ -47,9 +46,6 @@ class Oca extends BaseLLM {
}

static providerName = "oca";
static defaultOptions: Partial<LLMOptions> | undefined = {
apiBase: DEFAULT_OCA_BASE_URL,
};

protected useOpenAIAdapterFor: (LlmApiRequestType | "*")[] = [
"list",
Expand Down Expand Up @@ -98,7 +94,9 @@ class Oca extends BaseLLM {
);
}
const ocaHeaders = await createOcaHeaders(token, this.uniqueId);
console.log(`Making request with customer opc-request-id: ${ocaHeaders["opc-request-id"]}`)
console.log(
`Making request with customer opc-request-id: ${ocaHeaders["opc-request-id"]}`,
);
return ocaHeaders;
}

Expand All @@ -119,7 +117,9 @@ class Oca extends BaseLLM {
return completion;
}

protected _getEndpoint(endpoint: "chat/completions" | "models" | "model/info") {
protected _getEndpoint(
endpoint: "chat/completions" | "models" | "model/info",
) {
if (!this.apiBase) {
throw new Error(
"No API base URL provided. Please set the 'apiBase' option in config.json",
Expand Down Expand Up @@ -237,7 +237,7 @@ class Oca extends BaseLLM {
}

getModelInfo(model: string): ModelInfo | undefined {
return this.modelMap.models[model]
return this.modelMap.models[model];
}
}

Expand Down
25 changes: 11 additions & 14 deletions core/llm/llms/oca/util/constants.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import path from "path"
import os from "os"
import path from "path";
import os from "os";

// OAUTH
export const DEFAULT_IDCS_CLIENT_ID = "a8331954c0cf48ba99b5dd223a14c6ea"
export const DEFAULT_IDCS_URL = "https://idcs-9dc693e80d9b469480d7afe00e743931.identity.oraclecloud.com"
export const DEFAULT_IDSC_SCOPES = "openid offline_access"
export const DEFAULT_IDCS_PORT_CANDIDATES = [8669, 8668, 8667]
export const DEFAULT_USE_PKCE = true
export const OCA_CONFIG_PATH = path.join(os.homedir(), ".oca", "config.json")
export const OCA_RENEW_TOKEN_BUFFER_SEC = 180 // 3 minutes

// OCA LITELLM
export const DEFAULT_OCA_BASE_URL = "https://code-internal.aiservice.us-chicago-1.oci.oraclecloud.com/20250206/app/litellm"

export const DEFAULT_IDCS_CLIENT_ID = "a8331954c0cf48ba99b5dd223a14c6ea";
export const DEFAULT_IDCS_URL =
"https://idcs-9dc693e80d9b469480d7afe00e743931.identity.oraclecloud.com";
export const DEFAULT_IDSC_SCOPES = "openid offline_access";
export const DEFAULT_IDCS_PORT_CANDIDATES = [8669, 8668, 8667];
export const DEFAULT_USE_PKCE = true;
export const OCA_CONFIG_PATH = path.join(os.homedir(), ".oca", "config.json");
export const OCA_RENEW_TOKEN_BUFFER_SEC = 180; // 3 minutes
// OCA SURVEY
export const DEFAULT_SURVEY_PORT = 3000
export const DEFAULT_SURVEY_PORT = 3000;