Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
BruceMacD committed Jan 21, 2024
1 parent 9ff3b31 commit a952248
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as utils from "./utils.js";
import 'whatwg-fetch';
import { promises, createReadStream } from 'fs';
import { join, resolve, dirname } from 'path';
import { createHash } from 'crypto';
import { homedir } from 'os';
import * as utils from './utils.js'
import 'whatwg-fetch'
import { promises, createReadStream } from 'fs'
import { join, resolve, dirname } from 'path'
import { createHash } from 'crypto'
import { homedir } from 'os'

import type {
Fetch,
Expand Down Expand Up @@ -31,16 +31,16 @@ export class Ollama {
private readonly config: Config
private readonly fetch: Fetch

constructor (config?: Partial<Config>) {
this.config = {
address: config?.address ?? "http://127.0.0.1:11434"
};

this.fetch = fetch;
if (config?.fetch != null) {
this.fetch = config.fetch;
}
constructor(config?: Partial<Config>) {
this.config = {
address: config?.address ?? 'http://127.0.0.1:11434',
}

this.fetch = fetch
if (config?.fetch != null) {
this.fetch = config.fetch
}
}

private async processStreamableRequest<T extends object>(
endpoint: string,
Expand Down Expand Up @@ -316,4 +316,4 @@ export class Ollama {
}
}

export default new Ollama();
export default new Ollama()

0 comments on commit a952248

Please sign in to comment.