Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
This codebase provides a set of tools and workflows for interacting with language models (LLMs) in an asynchronous manner. It includes functionalities for generating text, streaming text, and structured extraction from messages and text inputs. The codebase is designed to be modular and extensible, allowing for easy integration of new tools and workflows.
To install the necessary dependencies, you can use the following command:
pip install llmtext
Ensure you have the required environment variables set up by creating a .env
file in the root directory with the necessary configurations.
To run the tests, use the following command:
pytest
Here is an example of how to use the asynchronous text generation functionality:
from llmtext.messages_fns import agenerate
from llmtext.data_types import Message
async def main():
text = await agenerate(
messages=[Message(role="user", content="what's the weather today ?")]
)
print(text)
import asyncio
asyncio.run(main())
Here is an example of how to use the agentic workflow functionality:
from llmtext.data_types import Message
from llmtext.workflows_fns import astream_agentic_workflow
from llmtext.data_types import RunnableTool
from typing import Annotated
from pydantic import Field
class SearchInternetTool(RunnableTool):
"""Tool to search internet"""
query: Annotated[str, Field(description="search query")]
async def arun(self) -> str:
return f"there's no result for: {self.query}"
async def main():
stream = astream_agentic_workflow(
messages=[
Message(role="user", content="what's the weather today ?"),
Message(
role="assistant",
content="there's no result for: what's the weather today ?",
),
],
tools=[SearchInternetTool],
)
async for chunk in stream:
print(chunk)
import asyncio
asyncio.run(main())
Contributions are welcome! Please follow the standard Git workflow:
This project is licensed under the MIT License. See the LICENSE file for more details.
For any questions or issues, please open an issue on GitHub.
FAQs
A simple llm library.
We found that llmtext demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.