lm-lib first commit;

git-svn-id: svn://home0/lm-lib@3603 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
This commit is contained in:
(no author)
2024-12-16 20:58:04 +00:00
commit c1a283305d
49 changed files with 3159 additions and 0 deletions

52
README.md Normal file
View File

@@ -0,0 +1,52 @@
This suite of Java packages provides a comprehensive framework for building, deploying, and interacting with conversational AI agents powered by language models.
**Core Functionality:**
* **Agent Framework:** Enables the creation of modular and scalable agents with complex branching logic and concurrent execution capabilities.
* **Language Model Interaction:** Provides tools for accessing and interacting with various language models, including Azure AI's text generation service. This includes retrieving model information, managing conversations, generating completions, and customizing parameters.
* **Prompt Engineering:** Offers functionalities for constructing and manipulating prompts tailored to specific language models, supporting various formatting strategies.
* **Text Processing:** Includes tools for tokenizing and detokenizing text, essential for preparing input for language models and interpreting their output.
**Purpose:**
The primary purpose of this program is to simplify the development and deployment of sophisticated conversational AI agents. By providing a robust set of tools for agent management, language model interaction, prompt engineering, and text processing, the program empowers developers to create powerful and engaging AI-driven conversational experiences.
*gemma2-27b requests=49, requestDuration=PT7M4.534240136S, inTokens=26243, outTokens=2159, tps=5.091981132075472*
## Introducing a Powerful Framework for Building Intelligent Agents
We're excited to announce the development of a new Java codebase designed to build intelligent agents capable of interacting with language models like GPT. This framework offers a flexible and extensible architecture, empowering developers to create sophisticated conversational agents for a wide range of applications.
**Key Features:**
* **Concurrent Text Processing:** Leveraging Java's `CompletableFuture` and `ExecutorService`, the framework enables parallel processing of text chunks, significantly speeding up agent execution.
* **Response-Driven Agent Selection:** The `chooseNextAgent` method intelligently selects the next agent in the chain based on the response received from the language model, allowing for dynamic and adaptive conversations.
* **Customizable Response Handling:** Each agent can be equipped with a custom `responseHandler` to parse and interpret responses from the language model, enabling tailored logic for specific tasks.
* **Dynamic Agent Chaining:** Agents can be chained together to create complex, multi-step interactions, with each agent specializing in a particular task and passing context to the next.
* **Contextualized Agent Execution:** The framework utilizes an `AgentContext` object to store and share information between agents, ensuring each agent has access to the relevant context for its task.
**How it Works:**
The framework revolves around the `Agent` class, which defines an agent's behavior and interaction with the language model. Each agent receives an `AgentContext` containing relevant information, processes text using its defined template, interacts with the language model, and then uses its `responseHandler` to interpret the response. Based on the response, the `chooseNextAgent` method determines the next agent in the chain.
**Benefits:**
This framework offers several advantages for developers:
* **Flexibility:** Easily customize agent behavior through configurable parameters and custom response handlers.
* **Extensibility:** Add new agent types and functionalities as needed.
* **Efficiency:** Parallel processing and dynamic agent chaining optimize performance.
* **Adaptability:** Agents can respond intelligently to changing conversation contexts.
**Looking Ahead:**
We believe this framework has the potential to revolutionize the way we build conversational agents. We're actively developing new features and functionalities, and we encourage the community to contribute and explore the possibilities.
Stay tuned for more updates and documentation!
*Graph: M, CodeSummarizer, ↴, M, FeatureIdentifier, →, ⇉ 3/5, M, FeatureAnalyzer, →, 5↣1, M, AnswerGenerator*
*gemma2-27b requests=8, inTokens=19646, outTokens=2784, requestDuration=PT7M38.309006603S, getAbsoluteDuration()=PT3M54.653718763S, getTps()=95.59, getOutTps()=11.86*