Commit Graph

20 Commits

Author SHA1 Message Date
Nuno Campos f3ec6d2449 Replace remaining usage of basellm with baselangmodel (#3981) 2023-05-02 21:52:29 -07:00
Mike Wang 512c24fc9c [annotation improvement] Make AgentType->Class Conversion More Scalable (#3749)
In the current solution, AgentType and AGENT_TO_CLASS are placed in two
separate files and both manually maintained. This might cause
inconsistency when we update either of them.

— latest —
based on the discussion with hwchase17, we don’t know how to further use
the newly introduced AgentTypeConfig type, so it doesn’t make sense yet
to add it. Instead, it’s better to move the dictionary to another file
to keep the loading.py file clear. The consistency is a good point.
Instead of asserting the consistency during linting, we added a unittest
for consistency check. I think it works as auto unittest is triggered
every time with clear failure notice. (well, force push is possible, but
we all know what we are doing, so let’s show trust. :>)

~~This PR includes~~
- ~~Introduced AgentTypeConfig as the source of truth of all AgentType
related meta data.~~
- ~~Each AgentTypeConfig is a annotated class type which can be used for
annotation in other places.~~
- ~~Each AgentTypeConfig can be easily extended when we have more meta
data needs.~~
- ~~Strong assertion to ensure AgentType and AGENT_TO_CLASS are always
consistent.~~
- ~~Made AGENT_TO_CLASS automatically generated.~~

~~Test Plan:~~
- ~~since this change is focusing on annotation, lint is the major test
focus.~~
- ~~lint, format and test passed on local.~~
2023-04-28 21:17:28 -07:00
Amir Karimi ae7ed31386 Fix redundancy check about config_type in AGENT_TO_CLASS (#2934)
Fix of issue #2874
2023-04-17 21:05:48 -07:00
Harrison Chase e12e00df12 use output parsers in agents (#2987) 2023-04-16 13:15:21 -07:00
Harrison Chase b2bc5ef56a agent refactor (#2801) 2023-04-12 21:21:41 -07:00
Shrined 10dab053b4 Add Enum for agent types (#2321)
This pull request adds an enum class for the various types of agents
used in the project, located in the `agent_types.py` file. Currently,
the project is using hardcoded strings for the initialization of these
agents, which can lead to errors and make the code harder to maintain.
With the introduction of the new enums, the code will be more readable
and less error-prone.

The new enum members include:

- ZERO_SHOT_REACT_DESCRIPTION
- REACT_DOCSTORE
- SELF_ASK_WITH_SEARCH
- CONVERSATIONAL_REACT_DESCRIPTION
- CHAT_ZERO_SHOT_REACT_DESCRIPTION
- CHAT_CONVERSATIONAL_REACT_DESCRIPTION

In this PR, I have also replaced the hardcoded strings with the
appropriate enum members throughout the codebase, ensuring a smooth
transition to the new approach.
2023-04-03 21:56:20 -07:00
Harrison Chase 7cf46b3fee Harrison/convo agent (#1642) 2023-03-14 09:42:24 -07:00
Harrison Chase a094c49153 add chat agent (#1509) 2023-03-09 09:12:08 -08:00
Roy Williams 6086292252 Centralize logic for loading from LangChainHub, add ability to pin dependencies (#805)
It's generally considered to be a good practice to pin dependencies to
prevent surprise breakages when a new version of a dependency is
released. This commit adds the ability to pin dependencies when loading
from LangChainHub.

Centralizing this logic and using urllib fixes an issue identified by
some windows users highlighted in this video -
https://youtu.be/aJ6IQUh8MLQ?t=537
2023-01-30 14:52:17 -08:00
Harrison Chase 924b7ecf89 pass kwargs and bump (#770) 2023-01-27 08:56:36 -08:00
Harrison Chase e2a7fed890 Harrison/serialize from llm and tools (#760) 2023-01-26 23:30:39 -08:00
Harrison Chase 12dc7f26cc load agents from hub (#759) 2023-01-26 22:49:26 -08:00
Harrison Chase 1b89a438cf (wip) Harrison/serialize agents (#725) 2023-01-26 19:48:47 -08:00
Yong723 94c06c55e8 modify docstring (#569)
Sorry for the detail. this is a correction to the docstring.
2023-01-09 19:12:59 -08:00
Harrison Chase 74932f2516 RFC: conversational agent (#464)
Co-authored-by: Bruno Bornsztein <bruno.bornsztein@gmail.com>
2023-01-06 07:25:55 -08:00
Harrison Chase 9e04c34e20 Add BaseCallbackHandler and CallbackManager (#478)
Co-authored-by: Ankush Gola <9536492+agola11@users.noreply.github.com>
2023-01-04 07:54:25 -08:00
Harrison Chase cf98f219f9 Harrison/tools exp (#372) 2022-12-18 21:51:23 -05:00
Harrison Chase 3474f39e21 Harrison/improve cache (#368)
make it so everything goes through generate, which removes the need for
two types of caches
2022-12-18 16:22:42 -05:00
Harrison Chase 5d887970f6 change to agent (#173) 2022-11-22 18:02:20 -08:00
Harrison Chase d3a7429f61 (WIP) agents (#171) 2022-11-22 06:16:26 -08:00