-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from Portkey-AI/feat/lint-prettier
Linting + Prettier
- Loading branch information
Showing
38 changed files
with
4,023 additions
and
3,536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"semi": true, | ||
"tabWidth": 2, | ||
"printWidth": 80, | ||
"endOfLine": "lf", | ||
"singleQuote": true, | ||
"arrowParens": "always", | ||
"bracketSpacing": true, | ||
"trailingComma": "es5" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
export type Headers = Record<string, string | null | undefined> | ||
export type Headers = Record<string, string | null | undefined>; | ||
|
||
export interface ApiClientInterface { | ||
apiKey?: string | null; | ||
baseURL?: string | null; | ||
virtualKey?: string | null | undefined; | ||
config?: Record<string, unknown> | string | null | undefined; | ||
provider?: string | null | undefined; | ||
traceID?: string | null | undefined; | ||
metadata?: Record<string, unknown> | null | undefined; | ||
Authorization?: string | null | undefined; | ||
cacheForceRefresh?: boolean | null | undefined; | ||
debug?: boolean | null | undefined; | ||
customHost?: string | null | undefined; | ||
openaiProject?: string | null | undefined; | ||
openaiOrganization?: string | null | undefined; | ||
awsSecretAccessKey?: string | null | undefined; | ||
awsAccessKeyId?: string | null | undefined; | ||
awsSessionToken?: string | null | undefined; | ||
awsRegion?: string | null | undefined; | ||
vertexProjectId?: string | null | undefined; | ||
vertexRegion?: string | null | undefined; | ||
workersAiAccountId?: string | null | undefined; | ||
azureResourceName?: string | null | undefined; | ||
azureDeploymentId?: string | null | undefined; | ||
azureApiVersion?: string | null | undefined; | ||
azureEndpointName?: string | null | undefined; | ||
huggingfaceBaseUrl?: string | null | undefined; | ||
forwardHeaders?: Array<string> | null | undefined; | ||
cacheNamespace?: string | null | undefined; | ||
requestTimeout?: number | null | undefined; | ||
strictOpenAiCompliance?: boolean | null | undefined; | ||
anthropicBeta?: string | null | undefined; | ||
anthropicVersion?: string | null | undefined; | ||
mistralFimCompletion?: string | null | undefined; | ||
apiKey?: string | null; | ||
baseURL?: string | null; | ||
virtualKey?: string | null | undefined; | ||
config?: Record<string, unknown> | string | null | undefined; | ||
provider?: string | null | undefined; | ||
traceID?: string | null | undefined; | ||
metadata?: Record<string, unknown> | null | undefined; | ||
Authorization?: string | null | undefined; | ||
cacheForceRefresh?: boolean | null | undefined; | ||
debug?: boolean | null | undefined; | ||
customHost?: string | null | undefined; | ||
openaiProject?: string | null | undefined; | ||
openaiOrganization?: string | null | undefined; | ||
awsSecretAccessKey?: string | null | undefined; | ||
awsAccessKeyId?: string | null | undefined; | ||
awsSessionToken?: string | null | undefined; | ||
awsRegion?: string | null | undefined; | ||
vertexProjectId?: string | null | undefined; | ||
vertexRegion?: string | null | undefined; | ||
workersAiAccountId?: string | null | undefined; | ||
azureResourceName?: string | null | undefined; | ||
azureDeploymentId?: string | null | undefined; | ||
azureApiVersion?: string | null | undefined; | ||
azureEndpointName?: string | null | undefined; | ||
huggingfaceBaseUrl?: string | null | undefined; | ||
forwardHeaders?: Array<string> | null | undefined; | ||
cacheNamespace?: string | null | undefined; | ||
requestTimeout?: number | null | undefined; | ||
strictOpenAiCompliance?: boolean | null | undefined; | ||
anthropicBeta?: string | null | undefined; | ||
anthropicVersion?: string | null | undefined; | ||
mistralFimCompletion?: string | null | undefined; | ||
} | ||
|
||
export interface APIResponseType { | ||
getHeaders: () => Record<string, string> | null | undefined | ||
} | ||
getHeaders: () => Record<string, string> | null | undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
export interface RetrySettings { | ||
attempts: number; | ||
on_status_codes: Array<number> | ||
attempts: number; | ||
on_status_codes: Array<number>; | ||
} | ||
|
||
export interface FunctionInterface { | ||
name: string; | ||
description: string; | ||
parameters: string; | ||
name: string; | ||
description: string; | ||
parameters: string; | ||
} | ||
|
||
export interface ModelParams { | ||
model?: string; | ||
suffix?: string; | ||
max_tokens?: number; | ||
temperature?: number; | ||
top_k?: number; | ||
top_p?: number; | ||
n?: number; | ||
stop_sequences?: Array<any>; | ||
timeout?: number; | ||
functions?: Array<FunctionInterface>; | ||
function_call?: string | FunctionInterface; | ||
logprobs?: number; | ||
echo?: boolean; | ||
stop?: Array<string>; | ||
presence_penalty?: number; | ||
frequency_penalty?: number; | ||
best_of?: number; | ||
logit_bias?: Record<string, number>; | ||
user?: string; | ||
organization?: string; | ||
seed?: number; | ||
response_format?: any; | ||
service_tier?: string; | ||
top_logprobs?: number | null; | ||
parallel_tool_calls?: boolean; | ||
tools?: Array<Tool>; | ||
tool_choice?: any; | ||
[key: string]: any; | ||
model?: string; | ||
suffix?: string; | ||
max_tokens?: number; | ||
temperature?: number; | ||
top_k?: number; | ||
top_p?: number; | ||
n?: number; | ||
stop_sequences?: Array<any>; | ||
timeout?: number; | ||
functions?: Array<FunctionInterface>; | ||
function_call?: string | FunctionInterface; | ||
logprobs?: number; | ||
echo?: boolean; | ||
stop?: Array<string>; | ||
presence_penalty?: number; | ||
frequency_penalty?: number; | ||
best_of?: number; | ||
logit_bias?: Record<string, number>; | ||
user?: string; | ||
organization?: string; | ||
seed?: number; | ||
response_format?: any; | ||
service_tier?: string; | ||
top_logprobs?: number | null; | ||
parallel_tool_calls?: boolean; | ||
tools?: Array<Tool>; | ||
tool_choice?: any; | ||
[key: string]: any; | ||
} | ||
|
||
export interface Message { | ||
role: string | ||
content: string | ||
role: string; | ||
content: string; | ||
} | ||
|
||
export interface Tool { | ||
type?: string; | ||
function?: Record<string, any> | ||
} | ||
type?: string; | ||
function?: Record<string, any>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import type { Portkey } from "./index"; | ||
import type { Portkey } from './index'; | ||
|
||
export class ApiResource { | ||
protected client: Portkey; | ||
protected post: Portkey["_post"] | ||
protected put: Portkey["_put"] | ||
protected getMethod: Portkey["_get"] | ||
protected deleteMethod: Portkey["_delete"] | ||
protected client: Portkey; | ||
protected post: Portkey['_post']; | ||
protected put: Portkey['_put']; | ||
protected getMethod: Portkey['_get']; | ||
protected deleteMethod: Portkey['_delete']; | ||
|
||
constructor(client: Portkey) { | ||
this.client = client | ||
this.post = client._post.bind(client) | ||
this.put = client._put.bind(client) | ||
this.getMethod = client._get.bind(client) | ||
this.deleteMethod = client._delete.bind(client) // delete is a reserved word | ||
} | ||
} | ||
constructor(client: Portkey) { | ||
this.client = client; | ||
this.post = client._post.bind(client); | ||
this.put = client._put.bind(client); | ||
this.getMethod = client._get.bind(client); | ||
this.deleteMethod = client._delete.bind(client); // delete is a reserved word | ||
} | ||
} |
Oops, something went wrong.