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

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

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.

---q

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.5.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

sentient-0.1.5-py3-none-any.whl (63.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sentient-0.1.5.tar.gz
  • Upload date:
  • Size: 49.6 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.5.tar.gz
Algorithm Hash digest
SHA256 fbf12704b5b27f9f3a94ddeb03987093eab5940c2e3224053bf72c1dae24ae3d
MD5 75e96cd857c21a008a2a59d8d7f62b84
BLAKE2b-256 79cac1260fdf0e9818fd5e8c681e5d15a81f84c92ac850e843beeedbe4a04b15

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sentient-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 63.5 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5bb89a2cca2e91b8cb88037c41429cac7bc15e3c3371280f6d81e20a14b2e69b
MD5 fe1a016b8bac7715310d46575291c58f
BLAKE2b-256 7a115130fa2e1e57986891fe11d87f8a9b167e4040a54dfab72e5190133cf7e8

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