GithubHelp home page GithubHelp logo

faetalize / zodiac Goto Github PK

View Code? Open in Web Editor NEW
62.0 1.0 17.0 450 KB

A ⚡lightweight⚡ frontend for Google's Gemini Pro.

Home Page: https://zodiac.faetalize.dev/

License: GNU General Public License v3.0

HTML 46.09% JavaScript 53.91%
ai frontend gemini-api gemini-pro google llm collaborate github-codespaces github-pages student-vscode

zodiac's Introduction

!!!! THIS PROJECT IS STILL ACTIVE - I AM JUST TAKING A SMALL BREAK !!!!!

zodiac

A frontend built to interface with Google's Gemini Pro, built with vanilla JS. Get your API key here: Google AI Suite

image

How to use?

Download the repo, and open zodiac.html in a browser of your choice. That's it.

Alternatively, here's an online version you can try if you would rather not locally run it: zodiac online

Sponsor my development

You may support me finantially here: LiberaPay or Patreon I have zero plans to ever monetize my projects, no matter how popular they get. All features will be available to all. Your donations will be used in order to fund my technical needs (IDE subscriptions, testing products for RnD, etc)

zodiac's People

Contributors

faetalize avatar lyubomirt avatar mir-ashiq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

zodiac's Issues

messages should be sanitized

currently, if you send html tags, they will be rendered and not escaped. that is a problem. one could include <script> tags or other harmful inputs and they will be added to the document

chat input overhaul

Currently, it's hacky and hardcoded. It doesnt increase in height when the text wraps. Setting the height to scrollheight leads to uneven uncentered text.

CORS Policy Error When Loading Local JS File in HTML

Description

During local development, when trying to load a JavaScript file from an HTML file, I encountered a CORS policy error. The error message is as follows:

Access to script at 'file:///C:/Users/Administrator/Desktop/zodiac-dev/zodiac-dev/main.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.

This issue prevents the JavaScript file from loading properly, which affects the functionality of the page.

Steps to Reproduce

Place the HTML file and JavaScript file in a local folder.
Open the HTML file by double-clicking it or directly opening the file path file:///C:/Users/Administrator/Desktop/zodiac-dev/zodiac-dev/zodiac.html in the browser.
Observe the browser console to find the aforementioned CORS error.

Expected Behavior

The HTML file should be able to load and execute the local JavaScript file without interference from CORS policies.

Actual Behavior

The browser blocks the loading of the JavaScript file, throwing a CORS policy error.

Possible Solutions

It is recommended to set up a local development server, such as using Python's HTTP server module, or host the files through a web server software like Apache or Nginx. This can prevent CORS issues associated with opening files directly from the file system.

Environment Information

Operating System: Windows 10
Browser: Google Chrome Version 125.0.6422.142
File Path: C:/Users/Administrator/Desktop/zodiac-dev/zodiac-dev

split js from template

This project might benefit from decoupling the markup from the js, it grew too big and is somewhat unreadable.
a one file bundle can still be provided

Add a "regenerate reply" button

Markup:

  • Add a button in the bottom right or left of the message with a refresh icon

Code:

  • Pop the messages starting from the message to regenerate, and call the "run()" function with the last message as a parameter
  • add an event listener

Considerations

  • a refactoring of the run function will be required, so it can be used on any input
    async function run(input){
    //..
    }
    //..
    //changes to the event handler
    sendMessageButton.addEventListener("click", () => {
        run(...);
    });

You should add internet to it

https://abhaykoul-webscout1.hf.space/search this API URL will search 10 results from web if limit is not set, if you want you can you this API in your code

const https = require('https');
const readline = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});

readline.question('Enter your search query: ', (query) => {
    const url = "https://abhaykoul-webscout1.hf.space/search";
    const payload = JSON.stringify({ query: query, limit:  5 }); // Set limit to  5

    const options = {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'Content-Length': Buffer.byteLength(payload)
        }
    };

    const req = https.request(url, options, (res) => {
        let data = '';

        res.on('data', (chunk) => {
            data += chunk;
        });

        res.on('end', () => {
            try {
                const parsedData = JSON.parse(data);
                console.log(parsedData);
                // Process the data here
            } catch (e) {
                console.error('Error parsing JSON:', e);
            }
        });
    });

    req.on('error', (e) => {
        console.error('There was a problem with the request:', e.message);
    });

    req.write(payload);
    req.end();

    readline.close();
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.