Skip to main content

No project description provided

Project description

sentient - browser controlling agents in 3 lines of code

[beta]

from sentient import sentient
import asyncio
result = asyncio.run(sentient.invoke(goal="play shape of you on youtube"))

setup

  1. install sentient pip install sentient

  2. currently, you need to start chrome in dev mode - in a seaparate terminal on the port 9222. use the below commands to start the chrome instance and do necesssary logins if needed

for mac, use command -

sudo /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

to run brave browser (mac) -

sudo /Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser --remote-debugging-port=9222 --guest

for linux -

google-chrome --remote-debugging-port=9222

for windows -

"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
  1. setup open ai api key in a .env file or export OPENAI_API_KEY="sk-proj-"

  2. run the agent

from sentient import sentient
import asyncio

# if you wanna run in a jupyter notebook, uncomment the following two lines :
#import nest_asyncio
#nest_asyncio.apply()

result = asyncio.run(sentient.invoke("play shape of you on youtube"))
  1. note - by default we use gpt-4o-2024-08-06 from openai to run sentient as it is the best performing model. you can also use other models like gpt4o or gpt4o-mini but the reliabilty may take some hit.

setting custom task specific instructions

you can customise the agent's behaviour by providing natural language descripition of how it should naviagate or what all things it should keep in mind while executing a particualr task. this is helpful in improving the accuracy and reliability of the agent on your specific task.

from sentient import sentient
import asyncio

custom_instructions = """
1. Directly go to youtube.com rather than searching for the song on google!
"""

#use with open ai
result = asyncio.run(sentient.invoke(
    goal="play shape of you on youtube",
    task_instructions=custom_instructions,
    provider="openai",
    model="gpt-4o-2024-08-06"))

using providers other than open ai

we currently support togehter ai and ollama as providers. if you wish to have others included, please create a new issue. you can pass custom instructions in a similar fashion as shown above. you can also refer the cookbook for seeing all examples of using sentient with various providers.

using together ai hosted models

  1. set API key for Together AI - export TOGETHER_API_KEY="your-api-key"

  2. pass provider and model options to the invoke command.

#use with together ai
result = asyncio.run(sentient.invoke(
    goal="play shape of you on youtube",
    provider="together",
    model="meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo"))

using ollama

  1. ensure the ollama server is on. you just need to pass the name of the model.
#use with ollama
result = asyncio.run(sentient.invoke(
    goal="play shape of you on youtube",
    provider="ollama",
    model="llama3"))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sentient-0.1.7.tar.gz (49.8 kB view details)

Uploaded Source

Built Distribution

sentient-0.1.7-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

Details for the file sentient-0.1.7.tar.gz.

File metadata

  • Download URL: sentient-0.1.7.tar.gz
  • Upload date:
  • Size: 49.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.6.0

File hashes

Hashes for sentient-0.1.7.tar.gz
Algorithm Hash digest
SHA256 f9d5a4a0e480059e8251ca41e9468f2a9a64bc3f9827518e40b347771a7ed16d
MD5 98eac3bfb85c7e6650604398f6266d98
BLAKE2b-256 149b689dde5da8022d3a1bd914e376a957c20733cb4f0ad018023d2b58d6aa4b

See more details on using hashes here.

File details

Details for the file sentient-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: sentient-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.6.0

File hashes

Hashes for sentient-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1be5d607bf9a8d245f9a9a63414168f32852dbc80950db9ca093cc671bade50a
MD5 eed13ccc8b1f8a27c41245802355075c
BLAKE2b-256 91e940b4c269db6108cc17b2300c8af8aac4266662f61d83ff4ec2c45397242b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page