Robodog is a GPT client with support for gpt-3.5-turbo, gpt-4, gpt-4-turbo, dall-e-3, and gpt-3.5-turbo-16k. A highly portal GPT UI with support for upload files, save points, and temperature configurations.
npm install robodoglibrobodog.html and a JavaScript bundle called robotdog.bundle.js. Additionally, the tool does not require npm installation as it simply prompts for the API key, which is stored in local storage.
javascript
const _messages = [
{ role: "user", content: "chat history:" + context },
{ role: "user", content: "knowledge:" + knowledge },
{ role: "user", content: "question:" + text + ". Use the content in knowledge and chat history to answer the question." }
];
`
Import
Use the /import command to open a file picker. You can select one or more files, and they will be imported into the knowledge text area. You can use the /export feature to dump the content of your knowledge into a file.
!Features
Indicators
Use the char, rest, stream, status sloth/ape indicators to streamline your experience.
- [0/9000][gpt-3.5-turbo][0.7][stream][π¦₯][π][][]
- [3432/9000] - estimated remaining context + knowledge + chat
- [gpt-3.5-turbo] - GPT model
- [0.7] - temperature - larger numbers promote more creativity and are more prone to hallucination
- [rest] - rest completion mode
- [stream] - stream completion mode
- [π¦₯] - ready
- [π¦§] - thinking
- [gpt-3.5-turbo-1106] - GPT model
- [π] - π¬ππ is dangerously large. Good luck to you.
- [π¦] - π¬ππ is very large.
- [π] - π¬ππ is large.
- [π] - π¬ππ is acceptable.
Emoji
Role Emojis:
- πΎ - User
- π€ - Assistant
- πΎ - System
- πΉ - Event
- π© - Error
- π - Warning
- πΉ - Info
- π£ - Experiment
- π - Default
Status Emojis:
- π¦₯ - Ready
- 𦧠- Thinking
- π - Dangerously large
- π¦ - Very large
- π - Large
- π - Acceptable
Performance Emojis:
- π’ - Tortoise - longer than 20 seconds
- π¦
- Hourglass - less than 1 second or more than 5 seconds
- π¦ - Kangaroo
- π - Leopard
- π¦ - Deer
- π - Dog
- π
- Tiger
- π - Cat
Other Emojis:
- π - Chat History
- π - Knowledge Content
- π¬ - Chat Text
!Features
Stash, pop, and list
Switch chat contexts using the stash, pop, and list commands.
- /stash - stash π¬ππ.
- /pop - pop π¬ππ.
- /list - list of stashed π¬ππ.
!Mobile
Menu
Use the drop-down menu to select options.
!Features
Optical Character Recognition (OCR) support using the Tesseract library
Optical Character Recognition (OCR) is the process that converts an image of text into a machine-readable text format. For example, if you scan a form or a receipt, your computer saves the scan as an image file. You cannot use a text editor to edit, search, or count the words in the image file.
- image-to-text using Tesseract
- text-to-image using dall-e-3
!Features
Build
- cd robodog
- npm install
- npm install openai
- npm install zip-webpack-plugin
- npm install pdfjs-dist
- npm install axios
- npm run build
Run
- Open .\dist\robodog.html in a browser.
Commands
- /gpt-3.5-turbo - switch to gpt-3.5-turbo-1106 model (4,096 tokens)(default).
- /gpt-3.5-turbo-16k - switch to gpt-3.5-turbo-16k model (16,385 tokens).
- /gpt-3.5-turbo-1106 - switch to gpt-3.5-turbo-1106 model (16,385 tokens).
- /gpt-4 - switch to gpt-4 model (8,192 tokens).
- /gpt-4-1106-preview - switch to gpt-4-1106-preview model (128,000 tokens).
- /search
- /model - set to a specific model.
- /model dall-e-3
- /help - get help.
- /import - import files into knowledge (.md, .txt, .pdf, .js, .cs, .java, .py, json, .yaml, .php, .csv, .xsql, .json, .xml).
- /export - export knowledge to a file.
- /clear - clear π¬ππ.
- /reset - reset all settings
- /rest - use rest completions.
- /toggle - toggle context and knowledge text areas
- /stream - use stream completions (default).
- /reset - Reset your API key.
- /stash - stash π¬ππ.
- /stash clear
- /pop - pop π¬ππ.
- /list - list of stashed π¬ππ.
- /temperature 0.7 - If your use case allows for high variability or personalization (such as product recommendations) from user to user, we recommend a temperature of 0.7 or higher. For more static responses, such as answers to FAQs on return policies or shipping rates, adjust it to 0.4. Weβve also found that with a higher temperature metric, the model tends to add 10 to 15 words on top of your word/token limit, so keep that in mind when setting your parameters.
- /max_tokens 500 - for short, concise responses (which in our experience is always best), choose a value between 30 and 50, depending on the main use cases of your chatbot.
- /top_p 1 - recommend keeping this at 1, adjusting your temperature instead for the best results.
- /frequency_penalty 0 - determine how often the same words appear in the chatbotβs response. Keep at 0.
- /presence_penalty 0 - determine how often the same words appear in the chatbotβs response. Keep at 0.
- SHIFT+UP - cycle through stash list.
- CTRL + S - save a snapshot to storage.
Try
- Robodog
Download
- Download Robodog
RobodogLib
To use RobodogLib in your project, follow these steps:
0. Install
`
npm install RobodogLib
`
1. Importing the necessary libraries:
`javascript
import { FileService } from 'RobodogLib';
import { SearchService } from 'RobodogLib';
import { ProviderService } from 'RobodogLib';
import { RouterModel } from 'RobodogLib';
import { PerformanceCalculator } from 'RobodogLib';
import { FormatService } from 'RobodogLib';
import { ConsoleService } from 'RobodogLib';
import { YamlConfigService } from 'RobodogLib';
`
2. Extracting text content from various file formats:
`javascript
const fileService = new FileService();
// Example 1: Extracting text from a PDF file
const pdfFile = new File([''], 'example.pdf', { type: 'application/pdf' });
fileService.getTextFromArrayBuffer(pdfFile.arrayBuffer, pdfFile.type, pdfFile.name)
.then((result) => {
console.log('PDF File Text:', result);
})
.catch((error) => {
console.error('Error extracting text from PDF file:', error);
});
// Example 2: Extracting text from an image file
const imageFile = new File([''], 'example.jpg', { type: 'image/jpeg' });
fileService.getTextFromArrayBuffer(imageFile.arrayBuffer, imageFile.type, imageFile.name)
.then((result) => {
console.log('Image File Text:', result);
})
.catch((error) => {
console.error('Error extracting text from image file:', error);
});
// Example 3: Extracting text from a plain text file
const textFile = new File([''], 'example.txt', { type: 'text/plain' });
fileService.getTextFromArrayBuffer(textFile.arrayBuffer, textFile.type, textFile.name)
.then((result) => {
console.log('Text File Text:', result);
})
.catch((error) => {
console.error('Error extracting text from text file:', error);
});
// Example 4: Handling unsupported file formats
const unsupportedFile = new File([''], 'example.docx', { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
fileService.getTextFromArrayBuffer(unsupportedFile.arrayBuffer, unsupportedFile.type, unsupportedFile.name)
.then((result) => {
console.log('Unsupported File Text:', result);
})
.catch((error) => {
console.error('Error extracting text from unsupported file:', error);
});
`
3. Searching for information using the SearchService:
`javascript
const searchService = new SearchService();
const text = "How to use RobodogLib?";
const setContent = (content) => {
// Update the content with the search results
};
searchService.search(text, setContent);
`
4. Managing configuration using the ProviderService and YamlConfigService:
`javascript
const providerService = new ProviderService();
const yamlConfigService = new YamlConfigService();
const defaultYaml = yamlConfigService.getDefaults();
const customYaml =
;
providerService.setYaml(customYaml);
const currentYaml = providerService.getYaml();
`
5. Handling performance calculations using the PerformanceCalculator:
`javascript
const performanceCalculator = new PerformanceCalculator();
performanceCalculator.start();
performanceCalculator.end();
const duration = performanceCalculator.calculateDuration();
`
6. Formatting messages using the FormatService:
`javascript
const formatService = new FormatService();
const message = formatService.getMessageWithTimestamp('Hello RobodogLib!', 'user');
const messageWithUrl = formatService.getMessageWithTimestamp('Here is the documentation:', 'assistant', 'https://robodoglib-docs.com');
`
7. Router Service example
`javascript
const routerService = new RobodogLib.RouterService();
const routerModel = new RobodogLib.RouterModel(
"How tall is devils tower?", // Question (required)
"gpt-4", // Model (required)
"Where is devils tower", // History (optional)
"places to climb: devils tower, custer state park, red river gorge", // Knowledge (optional)
[], // Content (optional)
0.8, // Temperature (optional)
50, // Max tokens (optional)
"", // Current key (optional)
"1792x1024", // Size (optional)
{
setContent: setContent,
setMessage: setMessage,
setPerformance: setPerformance,
setThinking: setThinking
}
);
const response = await routerService.routeQuestion(routerModel);
console.debug(response);
``