Skip to content

chatter is a simple way to access you.com's youchat llm from python using selenium!

License

Notifications You must be signed in to change notification settings

AashvikTyagi/pyseleniyouchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

pyselenichat

pyselenichat is a simple way to access you.com's youchat llm from python using selenium!

pyselenichat supports context!

i created this when i wanted a free way to access an llm from python. i had found https://github.com/Ruu3f/freeGPT and was super happy with it but it had one problem: there was no context to the next replies. that is, every time you queried the llm in your python script, it created a new 'session', so i couldn't ask successive questions or have a conversation with the llm while keeping context from previous messages. i found you.com after reading through the abovementioned freeGPT by Ruu3f (that is, freeGPT allows you to use gpt4 through you.com) and created this to use it.

my code accesses you.com and enters and reads text to and from different parts of the webpage (you.com) that i point to in my code by their xml path, which i determined by inspecting the page using firefox's dev tools.

you'll need to download [TO YOUR PATH] a specific browser driver (and change browser=webdriver.Firefox() in my code) depending on the browser you want selenium to control:

when you run the python script, it launches your chosen browser in headless mode, waits for it to load, and sends '::: ' in the terminal/output window for you to enter your prompt. it prints the answer once procured and prompts for your next answer. this loops till you kill the script.

!! the code currently waits for the answer to load by waiting for a loading sign element to appear and dissapear. this is very buggy as for short replies, it often doesn't appear, so i will be changing that soon. it does, currently, work very well for answers it takes longer to load !!

note: i'm not working on improving pyselenichat in general very actively but i will update it if i run into da problems and find da solutions.

About

chatter is a simple way to access you.com's youchat llm from python using selenium!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages