forked from ollama/ollama-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added constants and removed dangling strings for better code comprehensibility.
- Loading branch information
Showing
6 changed files
with
75 additions
and
33 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
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,31 @@ | ||
const EMPTY_STRING = '' | ||
const MESSAGES = { | ||
MISSING_BODY: 'Missing body', | ||
SUCCESS: 'Success', | ||
FETCHING_TEXT: 'Getting text from response', | ||
ERROR_FETCHING_TEXT: 'Failed to get text from error response', | ||
ERROR_NO_MODEL_FILE: 'Must provide either path or modelfile to create a model', | ||
ERROR_JSON_PARSE: 'Failed to parse error response as JSON', | ||
} as const | ||
const REQUEST_CONSTANTS = { | ||
GENERATE: 'generate', | ||
CREATE: 'create', | ||
PUSH: 'push', | ||
} as const | ||
const MODEL_FILE_COMMANDS = ['FROM', 'ADAPTER'] | ||
const OLLAMA_LOCAL_URL = 'http://127.0.0.1:11434' | ||
const SHA256 = 'sha256' | ||
const ENCODING = { | ||
HEX: 'hex', | ||
BASE64: 'base64', | ||
UTF8: 'utf8', | ||
} as const | ||
export { | ||
EMPTY_STRING, | ||
MESSAGES, | ||
REQUEST_CONSTANTS, | ||
MODEL_FILE_COMMANDS, | ||
OLLAMA_LOCAL_URL, | ||
SHA256, | ||
ENCODING, | ||
} |
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
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