Skip to content

Commit ada63cb

Browse files
committed
cleaned up API
1 parent 6d4697a commit ada63cb

File tree

3 files changed

+39
-51
lines changed

3 files changed

+39
-51
lines changed

examples/uploading-files.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/usr/bin/env -S npm run tsn -T
22

33
// Example of uploading a file
4-
5-
import { upload } from '../src/lib/upload';
4+
import { upload } from 'together-ai/lib/upload';
65

76
async function main() {
8-
//Upload a file
9-
const file = await upload('./examples/sample_finetuning.jsonl', 'fine-tune', true);
7+
// Upload a file
8+
const file = await upload('./examples/sample_finetuning.jsonl');
109
console.log('Uploaded file');
1110
console.log(file);
1211
}

src/lib/upload.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,8 @@ export async function check_jsonl(fileName: string): Promise<string | undefined>
159159
return undefined;
160160
}
161161

162-
export async function upload(
163-
fileName: string,
164-
purpose: string,
165-
check: boolean = true
166-
): Promise<FileResponse | ErrorResponse> {
162+
export async function upload(fileName: string, check: boolean = true): Promise<FileResponse | ErrorResponse> {
163+
let purpose = 'fine-tune';
167164
if (!fs.existsSync(fileName)) {
168165
return {
169166
message: 'File does not exists',

yarn.lock

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -940,62 +940,61 @@
940940
"@typescript-eslint/visitor-keys" "6.7.3"
941941
debug "^4.3.4"
942942

943-
"@typescript-eslint/scope-manager@6.21.0":
944-
version "6.21.0"
945-
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1"
946-
integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==
943+
"@typescript-eslint/scope-manager@6.7.3":
944+
version "6.7.3"
945+
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.3.tgz#07e5709c9bdae3eaf216947433ef97b3b8b7d755"
946+
integrity sha512-wOlo0QnEou9cHO2TdkJmzF7DFGvAKEnB82PuPNHpT8ZKKaZu6Bm63ugOTn9fXNJtvuDPanBc78lGUGGytJoVzQ==
947947
dependencies:
948-
"@typescript-eslint/types" "6.21.0"
949-
"@typescript-eslint/visitor-keys" "6.21.0"
948+
"@typescript-eslint/types" "6.7.3"
949+
"@typescript-eslint/visitor-keys" "6.7.3"
950950

951-
"@typescript-eslint/type-utils@6.21.0":
952-
version "6.21.0"
953-
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e"
954-
integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==
951+
"@typescript-eslint/type-utils@6.7.3":
952+
version "6.7.3"
953+
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.7.3.tgz#c2c165c135dda68a5e70074ade183f5ad68f3400"
954+
integrity sha512-Fc68K0aTDrKIBvLnKTZ5Pf3MXK495YErrbHb1R6aTpfK5OdSFj0rVN7ib6Tx6ePrZ2gsjLqr0s98NG7l96KSQw==
955955
dependencies:
956-
"@typescript-eslint/typescript-estree" "6.21.0"
957-
"@typescript-eslint/utils" "6.21.0"
956+
"@typescript-eslint/typescript-estree" "6.7.3"
957+
"@typescript-eslint/utils" "6.7.3"
958958
debug "^4.3.4"
959959
ts-api-utils "^1.0.1"
960960

961-
"@typescript-eslint/types@6.21.0":
962-
version "6.21.0"
963-
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d"
964-
integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==
961+
"@typescript-eslint/types@6.7.3":
962+
version "6.7.3"
963+
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.3.tgz#0402b5628a63f24f2dc9d4a678e9a92cc50ea3e9"
964+
integrity sha512-4g+de6roB2NFcfkZb439tigpAMnvEIg3rIjWQ+EM7IBaYt/CdJt6em9BJ4h4UpdgaBWdmx2iWsafHTrqmgIPNw==
965965

966-
"@typescript-eslint/typescript-estree@6.21.0":
967-
version "6.21.0"
968-
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46"
969-
integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==
966+
"@typescript-eslint/typescript-estree@6.7.3":
967+
version "6.7.3"
968+
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.3.tgz#ec5bb7ab4d3566818abaf0e4a8fa1958561b7279"
969+
integrity sha512-YLQ3tJoS4VxLFYHTw21oe1/vIZPRqAO91z6Uv0Ss2BKm/Ag7/RVQBcXTGcXhgJMdA4U+HrKuY5gWlJlvoaKZ5g==
970970
dependencies:
971-
"@typescript-eslint/types" "6.21.0"
972-
"@typescript-eslint/visitor-keys" "6.21.0"
971+
"@typescript-eslint/types" "6.7.3"
972+
"@typescript-eslint/visitor-keys" "6.7.3"
973973
debug "^4.3.4"
974974
globby "^11.1.0"
975975
is-glob "^4.0.3"
976-
minimatch "9.0.3"
977976
semver "^7.5.4"
978977
ts-api-utils "^1.0.1"
979978

980-
"@typescript-eslint/utils@6.21.0":
981-
version "6.21.0"
982-
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134"
983-
integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==
979+
"@typescript-eslint/utils@6.7.3":
980+
version "6.7.3"
981+
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.3.tgz#96c655816c373135b07282d67407cb577f62e143"
982+
integrity sha512-vzLkVder21GpWRrmSR9JxGZ5+ibIUSudXlW52qeKpzUEQhRSmyZiVDDj3crAth7+5tmN1ulvgKaCU2f/bPRCzg==
984983
dependencies:
985984
"@eslint-community/eslint-utils" "^4.4.0"
986985
"@types/json-schema" "^7.0.12"
987986
"@types/semver" "^7.5.0"
988-
"@typescript-eslint/scope-manager" "6.21.0"
989-
"@typescript-eslint/types" "6.21.0"
990-
"@typescript-eslint/typescript-estree" "6.21.0"
987+
"@typescript-eslint/scope-manager" "6.7.3"
988+
"@typescript-eslint/types" "6.7.3"
989+
"@typescript-eslint/typescript-estree" "6.7.3"
991990
semver "^7.5.4"
992991

993-
"@typescript-eslint/visitor-keys@6.21.0":
994-
version "6.21.0"
995-
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47"
996-
integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==
992+
"@typescript-eslint/visitor-keys@6.7.3":
993+
version "6.7.3"
994+
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.3.tgz#83809631ca12909bd2083558d2f93f5747deebb2"
995+
integrity sha512-HEVXkU9IB+nk9o63CeICMHxFWbHWr3E1mpilIQBe9+7L/lH97rleFLVtYsfnWB+JVMaiFnEaxvknvmIzX+CqVg==
997996
dependencies:
998-
"@typescript-eslint/types" "6.21.0"
997+
"@typescript-eslint/types" "6.7.3"
999998
eslint-visitor-keys "^3.4.1"
1000999

10011000
abort-controller@^3.0.0:
@@ -2744,13 +2743,6 @@ mimic-fn@^4.0.0:
27442743
resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz"
27452744
integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==
27462745

2747-
2748-
version "9.0.3"
2749-
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825"
2750-
integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==
2751-
dependencies:
2752-
brace-expansion "^2.0.1"
2753-
27542746
minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2:
27552747
version "3.1.2"
27562748
resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz"

0 commit comments

Comments
 (0)