Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/question answer with options #79

Merged
merged 4 commits into from
Mar 21, 2024

Conversation

Abraxas-365
Copy link
Owner

No description provided.

This commit introduces an Optional ChainCallOptions parameter to the load_stuff_qa function in both src/chain/question_answering.rs and src/chain/stuff_documents/chain.rs files to allow setting options while loading question and answering. A new load_stuff_qa_with_options function was also added to the StuffDocument struct to handle the new option.
Removed the unnecessary mutable declaration on  and consolidated the  assignment and building steps into one. All changes made in .
@Abraxas-365 Abraxas-365 merged commit d0644df into main Mar 21, 2024
2 checks passed
@prabirshrestha prabirshrestha deleted the feature/question_answer_with_options branch March 21, 2024 19:18
Abraxas-365 added a commit that referenced this pull request Mar 21, 2024
* refactor: Update OpenAI module with new functionality and structure improvements

* feat: adding from Tool trait to open ai fucntions

* feat(chain): add ChainCallOptions to load_stuff_qa functions

This commit introduces an Optional ChainCallOptions parameter to the load_stuff_qa function in both src/chain/question_answering.rs and src/chain/stuff_documents/chain.rs files to allow setting options while loading question and answering. A new load_stuff_qa_with_options function was also added to the StuffDocument struct to handle the new option.

* feat: streamline LLMChainBuilder in question_answering.rs

Removed the unnecessary mutable declaration on  and consolidated the  assignment and building steps into one. All changes made in .
Abraxas-365 added a commit that referenced this pull request Mar 21, 2024
* refactor: Update OpenAI module with new functionality and structure improvements

* feat: adding from Tool trait to open ai fucntions

* feat(chain): add ChainCallOptions to load_stuff_qa functions

This commit introduces an Optional ChainCallOptions parameter to the load_stuff_qa function in both src/chain/question_answering.rs and src/chain/stuff_documents/chain.rs files to allow setting options while loading question and answering. A new load_stuff_qa_with_options function was also added to the StuffDocument struct to handle the new option.

* feat: streamline LLMChainBuilder in question_answering.rs

Removed the unnecessary mutable declaration on  and consolidated the  assignment and building steps into one. All changes made in .
Abraxas-365 added a commit that referenced this pull request Mar 22, 2024
#76)

* refactor: Update OpenAI module with new functionality and structure improvements

* refactor(llm): changing with_option of llm trait to add_options (#78)

changing with_option of llm trait to add_options for redability

* Feature/question answer with options (#79)

* refactor: Update OpenAI module with new functionality and structure improvements

* feat: adding from Tool trait to open ai fucntions

* feat(chain): add ChainCallOptions to load_stuff_qa functions

This commit introduces an Optional ChainCallOptions parameter to the load_stuff_qa function in both src/chain/question_answering.rs and src/chain/stuff_documents/chain.rs files to allow setting options while loading question and answering. A new load_stuff_qa_with_options function was also added to the StuffDocument struct to handle the new option.

* feat: streamline LLMChainBuilder in question_answering.rs

Removed the unnecessary mutable declaration on  and consolidated the  assignment and building steps into one. All changes made in .

* refactor: change order for redability

* feat: add OpenAiToolAgent and related changes

Implemented OpenAiToolAgent functionality allowing a tool to function as an AI agent, using a new OpenAiToolAgentBuilder. This involved various file changes and additions across several modules.

A new function was added to the CallOptions struct, merge_options, to help manage setting options between the default set and those incoming from user configurations.

The AgentAction struct now includes a "log" field, and a new struct, LogTools, was introduced.

Modified several tool-related files (WebScrapper, SerpApi, Wolfram) to utilize the new interface and updated traits provided by the OpenAiToolAgent. This included changing the function signature for the  function to  and additionally revising the input type from string to serde_json::Value.

In the messages module, added a new MessageType variant for ToolMessage and included a new function to create new Tool messages. Further, "tool_calls" was added as an optional field to the Message struct.

New schemas, FunctionCallBehavior and FunctionDefinition, were added to replace those removed from the language_models options module. A corresponding tools_openai_like module was added under schemas to house these additions.

* Feature/question answer with options (#79)

* refactor: Update OpenAI module with new functionality and structure improvements

* feat: adding from Tool trait to open ai fucntions

* feat(chain): add ChainCallOptions to load_stuff_qa functions

This commit introduces an Optional ChainCallOptions parameter to the load_stuff_qa function in both src/chain/question_answering.rs and src/chain/stuff_documents/chain.rs files to allow setting options while loading question and answering. A new load_stuff_qa_with_options function was also added to the StuffDocument struct to handle the new option.

* feat: streamline LLMChainBuilder in question_answering.rs

Removed the unnecessary mutable declaration on  and consolidated the  assignment and building steps into one. All changes made in .

* refactor: delete println

* refactor: delete println

* feat: Refactor agent creation and add OpenAiToolAgent example

This update changes the chain of responsibility in the agent creation process. Removed the OpenAiToolAgent from examples/agent.rs and created a separate OpenAiToolAgent in examples/open_ai_tools_agent.rs. It also adjusts the ability to add tools to an agent in src/agent/chat/builder.rs, changes the  method to accept a slice instead of a vector. Tests were adjusted as well to match this new method signature in src/agent/chat/chat_agent.rs.

* refactor: delete unused imports

* chore: Update tool.rs with additional documentation and method implementations

- Added a method to provide a description of the tool
- Updated formatting and comments for better readability
- Implemented methods for parsing input, running the tool, and calling the tool asynchronously

This commit improves the documentation and functionality of the tool.rs file.

* chore: Update code with additional documentation

* fix: make open ai work if agent return multiple tools

* chore: trim and replace whitespace with underscores in tool names

* chore: adding open ai tool agent example with multiples tools

* chore:fixing examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant