Git Product home page Git Product logo

agent-smith-ai's Issues

tests for api endpoint wrapping

this has been mostly tested with simple endpoints and query params; need to spruce up the ApiWrapper code a bit and make sure we can handle other param types (esp. body and path)

options for error handling

Currently pretty much all errors are caught and returned within a message to the user. This is robust for interactive dependent use, but not great for example when running automated tests, where we want to raise errors so the caller can try again. Probably there should be an option in .chat() for "error_handle", for capture and return in message, raise to parent caller, or maybe retry (but this depends on the nature of the error). Related to #17 .

better extraction/definition of api endpoint names

There's a regex they check for: {'session_id': '195022ac-6041-4a65-a98b-cf38f02888f0', 'message': {'role': 'assistant', 'author': 'System', 'intended_recipient': 'User', 'is_function_call': False, 'content': "Error in sending function or method call result to model: 'go.get_term_by_name' does not match '^[a-zA-Z0-9_-]{1,64}$' - 'messages.4.function_call.name'", 'func_name': None, 'func_arguments': None, 'finish_reason': None}, 'agent': 'GO Assistant (GPT-3.5)'}

currently I'm using whatever fastapi defines the endpoint operation id as (right?), which might be too long/convoluted

allow non-methods as callable endpoints

Currently devs can register callable methods (only) by defining the method as part of the agent class and registering it by name (string). May as well allow any callable, but this will be a breaking change.

cleanup new_chat and continue_chat

These are getting really redundant in code and probably we could just do with a generic .process_message() or something to handle both cases. This would be a breaking change.

gracefully handle errors in function calling

rarely the model will try to pass a function parameter that doesn't exist; e.g.

Error in message processing: SemanticScholarAgent.search() got an unexpected keyword argument 'sort'. Full Traceback: Traceback (most recent call last): File "/Users/oneils/Library/Caches/pypoetry/virtualenvs/oneilsh-agent-explorations-2v5X1dTk-py3.11/lib/python3.11/site-packages/agent_smith_ai/utility_agent.py", line 159, in chat for message in self._process_model_response(response_raw, intended_recipient = author): File "/Users/oneils/Library/Caches/pypoetry/virtualenvs/oneilsh-agent-explorations-2v5X1dTk-py3.11/lib/python3.11/site-packages/agent_smith_ai/utility_agent.py", line 393, in _process_model_response for potential_message in func_result: File "/Users/oneils/Library/Caches/pypoetry/virtualenvs/oneilsh-agent-explorations-2v5X1dTk-py3.11/lib/python3.11/site-packages/agent_smith_ai/utility_agent.py", line 230, in _call_function result = func(**params) ^^^^^^^^^^^^^^ TypeError: SemanticScholarAgent.search() got an unexpected keyword argument 'sort'

add a UI component

early attempts at building one from scratch (agentserver webapp) lacked security, especially since it consisted of a server-side component callable by nefarious clients

this repo contains a streamlit app that can wrap these agents, it should be rolled into here to make it super duper easy to deploy a web-based chat smart agent, replacing the current attempts at an 'agent server'

Better error for function doc parsing

This rather cryptic error comes from not being able to parse the type hint info to generate docs for functions; need to provide a better error message to let the dev know they are missing a type hint or something.

NotImplementedError: Unsupported type: <class 'inspect._empty'>
...
File "/Users/oneils/Library/Caches/pypoetry/virtualenvs/oneilsh-agent-explorations-2v5X1dTk-py3.11/lib/python3.11/site-packages/agent_smith_ai/utility_agent.py", line 511, in _python_type_to_json_schema
    raise NotImplementedError(f'Unsupported type: {py_type}')

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.