langchain-zunno 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,200 @@
1
+ Metadata-Version: 2.4
2
+ Name: langchain-zunno
3
+ Version: 0.1.0
4
+ Summary: LangChain integration for Zunno LLM and Embeddings
5
+ Home-page: https://github.com/zunno/langchain-zunno
6
+ Author: Amit Kumar
7
+ Author-email: Amit Kumar <amit@zunno.ai>
8
+ Maintainer-email: Amit Kumar <amit@zunno.ai>
9
+ License: MIT
10
+ Project-URL: Homepage, https://github.com/zunno/langchain-zunno
11
+ Project-URL: Documentation, https://github.com/zunno/langchain-zunno#readme
12
+ Project-URL: Repository, https://github.com/zunno/langchain-zunno
13
+ Project-URL: Bug Tracker, https://github.com/zunno/langchain-zunno/issues
14
+ Keywords: langchain,llm,embeddings,zunno,ai,machine-learning
15
+ Classifier: Development Status :: 3 - Alpha
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
+ Requires-Python: >=3.8
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: langchain>=0.1.0
31
+ Requires-Dist: langchain-core>=0.1.0
32
+ Requires-Dist: requests>=2.25.0
33
+ Requires-Dist: httpx>=0.24.0
34
+ Requires-Dist: pydantic>=2.0.0
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
37
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
38
+ Requires-Dist: black>=22.0.0; extra == "dev"
39
+ Requires-Dist: isort>=5.0.0; extra == "dev"
40
+ Requires-Dist: flake8>=4.0.0; extra == "dev"
41
+ Dynamic: author
42
+ Dynamic: home-page
43
+ Dynamic: license-file
44
+ Dynamic: requires-python
45
+
46
+ # LangChain Zunno Integration
47
+
48
+ A LangChain integration for Zunno LLM and Embeddings, providing easy-to-use wrappers for text generation and embeddings.
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ pip install langchain-zunno
54
+ ```
55
+
56
+ ## Quick Start
57
+
58
+ ### Text Generation (LLM)
59
+
60
+ ```python
61
+ from langchain_zunno import ZunnoLLM
62
+
63
+ # Create an LLM instance
64
+ llm = ZunnoLLM(model_name="mistral:latest")
65
+
66
+ # Generate text
67
+ response = llm.invoke("Hello, how are you?")
68
+ print(response)
69
+ ```
70
+
71
+ ### Embeddings
72
+
73
+ ```python
74
+ from langchain_zunno import ZunnoLLMEmbeddings
75
+
76
+ # Create an embeddings instance
77
+ embeddings = ZunnoLLMEmbeddings(model_name="mistral:latest")
78
+
79
+ # Get embeddings for a single text
80
+ embedding = embeddings.embed_query("Hello, how are you?")
81
+ print(f"Embedding dimension: {len(embedding)}")
82
+
83
+ # Get embeddings for multiple texts
84
+ texts = ["Hello world", "How are you?", "Good morning"]
85
+ embeddings_list = embeddings.embed_documents(texts)
86
+ print(f"Number of embeddings: {len(embeddings_list)}")
87
+ ```
88
+
89
+ ### Async Usage
90
+
91
+ ```python
92
+ import asyncio
93
+ from langchain_zunno import ZunnoLLM, ZunnoLLMEmbeddings
94
+
95
+ async def main():
96
+ # Async LLM
97
+ llm = ZunnoLLM(model_name="mistral:latest")
98
+ response = await llm.ainvoke("Hello, how are you?")
99
+ print(response)
100
+
101
+ # Async embeddings
102
+ embeddings = ZunnoLLMEmbeddings(model_name="mistral:latest")
103
+ embedding = await embeddings.aembed_query("Hello, how are you?")
104
+ print(f"Embedding dimension: {len(embedding)}")
105
+
106
+ asyncio.run(main())
107
+ ```
108
+
109
+ ## Factory Functions
110
+
111
+ For convenience, you can use factory functions to create instances:
112
+
113
+ ```python
114
+ from langchain_zunno import create_zunno_llm, create_zunno_embeddings
115
+
116
+ # Create LLM
117
+ llm = create_zunno_llm(
118
+ model_name="mistral:latest",
119
+ temperature=0.7,
120
+ max_tokens=100
121
+ )
122
+
123
+ # Create embeddings
124
+ embeddings = create_zunno_embeddings(
125
+ model_name="mistral:latest"
126
+ )
127
+ ```
128
+
129
+ ## Configuration
130
+
131
+ ### LLM Configuration
132
+
133
+ - `model_name`: The name of the model to use
134
+ - `base_url`: API endpoint (default: "http://15.206.124.44/v1/prompt-response")
135
+ - `temperature`: Controls randomness in generation (default: 0.7)
136
+ - `max_tokens`: Maximum number of tokens to generate (optional)
137
+ - `timeout`: Request timeout in seconds (default: 300)
138
+
139
+ ### Embeddings Configuration
140
+
141
+ - `model_name`: The name of the embedding model to use
142
+ - `base_url`: API endpoint (default: "http://15.206.124.44/v1/text-embeddings")
143
+ - `timeout`: Request timeout in seconds (default: 300)
144
+
145
+ ## API Endpoints
146
+
147
+ The package connects to the following Zunno API endpoints:
148
+
149
+ - **Text Generation**: `http://15.206.124.44/v1/prompt-response`
150
+ - **Embeddings**: `http://15.206.124.44/v1/text-embeddings`
151
+
152
+ ## Error Handling
153
+
154
+ The package includes comprehensive error handling:
155
+
156
+ ```python
157
+ try:
158
+ response = llm.invoke("Hello")
159
+ except Exception as e:
160
+ print(f"Error: {e}")
161
+ ```
162
+
163
+ ## Development
164
+
165
+ ### Installation for Development
166
+
167
+ ```bash
168
+ git clone https://github.com/zunno/langchain-zunno.git
169
+ cd langchain-zunno
170
+ pip install -e ".[dev]"
171
+ ```
172
+
173
+ ### Running Tests
174
+
175
+ ```bash
176
+ pytest
177
+ ```
178
+
179
+ ### Code Formatting
180
+
181
+ ```bash
182
+ black .
183
+ isort .
184
+ ```
185
+
186
+ ## License
187
+
188
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
189
+
190
+ ## Contributing
191
+
192
+ 1. Fork the repository
193
+ 2. Create a feature branch
194
+ 3. Make your changes
195
+ 4. Add tests
196
+ 5. Submit a pull request
197
+
198
+ ## Support
199
+
200
+ For support, please open an issue on GitHub or contact us at support@zunno.ai.
@@ -0,0 +1,5 @@
1
+ langchain_zunno-0.1.0.dist-info/licenses/LICENSE,sha256=dfF1ZH0fV045UpyRp_biKmKgCnMzhtoI3LDb38A3BTY,1062
2
+ langchain_zunno-0.1.0.dist-info/METADATA,sha256=kii1tui8XG2eyCZ6rJFk8DRpCAULR0iUtu48cM1VcAE,5218
3
+ langchain_zunno-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
+ langchain_zunno-0.1.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
+ langchain_zunno-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Zunno
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.