Skip to main content

A brief description of the package.

Project description

Quickstart

First install the packages:

pip install pure_agent 

setup your config.yaml

env:
  api_key: xxx
infer_params:
  model: gpt-4o-mini
  temperature: 0.8
  top_p: 0.8
  max_tokens: 512

write your first agent based on pure_agent!

from pure_agent import *

class MyAgent(BaseAgent):
    @append_msg('msgs')
    def greeting(self, sys_name, prompt):
        with RoleCtx('system'):
            yield f"You are a helpful assistant, your name is {sys_name}."
        with RoleCtx('user'):
            yield prompt

sys_names = ['pbot0', 'pbot1']
prompts = ['who are u?', 'who are u?']
with MultiThreadExecutor(10, '.cache') as pool:
    for i in range(len(sys_names)):
        agent = MyAgent(client_config='config.yaml')
        task = agent.greeting(sys_names[i], prompts[i])
        # print(pretty_print_nested(msgs))
        pool.submit(task)

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

pure_agent-0.1.1.tar.gz (8.0 kB view details)

Uploaded Source

File details

Details for the file pure_agent-0.1.1.tar.gz.

File metadata

  • Download URL: pure_agent-0.1.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for pure_agent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 32c97a0146c7fa6545bc6a868b4b6e02f8c535389d76cb283dfd841e83e3441f
MD5 d21d289f4bbacaee8fc90acaa472b10c
BLAKE2b-256 b86bd33c43745ac068090b9a51256b429aff03148c2ce5500c53619540216e7a

See more details on using hashes here.

Supported by

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