Skip to content

Commit 8dc8798

Browse files
author
Sam Partee
authored
LLMCache (#17)
Introduce ``LLMCache`` library api. This allows users to use a semantic cache in their applications through utilizing Redisvl.
1 parent 801ba9c commit 8dc8798

23 files changed

+760
-97
lines changed

.pylintrc

+346
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,346 @@
1+
[MASTER]
2+
3+
# Use multiple processes to speed up Pylint.
4+
jobs=4
5+
6+
# Pickle collected data for later comparisons.
7+
persistent=yes
8+
9+
# When enabled, pylint would attempt to guess common misconfiguration and emit
10+
# user-friendly hints instead of false-positive error messages.
11+
suggestion-mode=yes
12+
13+
14+
[MESSAGES CONTROL]
15+
16+
disable=logging-fstring-interpolation,
17+
print-statement,
18+
parameter-unpacking,
19+
unpacking-in-except,
20+
old-raise-syntax,
21+
backtick,
22+
long-suffix,
23+
old-ne-operator,
24+
old-octal-literal,
25+
import-star-module-level,
26+
non-ascii-bytes-literal,
27+
raw-checker-failed,
28+
bad-inline-option,
29+
locally-disabled,
30+
file-ignored,
31+
suppressed-message,
32+
useless-suppression,
33+
deprecated-pragma,
34+
use-symbolic-message-instead,
35+
apply-builtin,
36+
basestring-builtin,
37+
buffer-builtin,
38+
cmp-builtin,
39+
coerce-builtin,
40+
execfile-builtin,
41+
file-builtin,
42+
long-builtin,
43+
raw_input-builtin,
44+
reduce-builtin,
45+
standarderror-builtin,
46+
unicode-builtin,
47+
xrange-builtin,
48+
coerce-method,
49+
delslice-method,
50+
getslice-method,
51+
setslice-method,
52+
no-absolute-import,
53+
old-division,
54+
dict-iter-method,
55+
dict-view-method,
56+
next-method-called,
57+
metaclass-assignment,
58+
indexing-exception,
59+
raising-string,
60+
reload-builtin,
61+
oct-method,
62+
hex-method,
63+
nonzero-method,
64+
cmp-method,
65+
input-builtin,
66+
round-builtin,
67+
intern-builtin,
68+
unichr-builtin,
69+
map-builtin-not-iterating,
70+
zip-builtin-not-iterating,
71+
range-builtin-not-iterating,
72+
filter-builtin-not-iterating,
73+
using-cmp-argument,
74+
eq-without-hash,
75+
div-method,
76+
idiv-method,
77+
rdiv-method,
78+
exception-message-attribute,
79+
invalid-str-codec,
80+
sys-max-int,
81+
bad-python3-import,
82+
deprecated-string-function,
83+
deprecated-str-translate-call,
84+
deprecated-itertools-function,
85+
deprecated-types-field,
86+
next-method-defined,
87+
dict-items-not-iterating,
88+
dict-keys-not-iterating,
89+
dict-values-not-iterating,
90+
deprecated-operator-function,
91+
deprecated-urllib-function,
92+
xreadlines-attribute,
93+
deprecated-sys-function,
94+
exception-escape,
95+
comprehension-escape
96+
bad-continuation,
97+
invalid-name,
98+
too-many-instance-attributes,
99+
too-many-arguments,
100+
unused-argument,
101+
wrong-import-order,
102+
missing-module-docstring,
103+
missing-class-docstring,
104+
missing-function-docstring,
105+
too-many-branches,
106+
too-many-nested-blocks,
107+
no-self-use,
108+
no-else-break,
109+
broad-except,
110+
pointless-string-statement
111+
112+
enable=useless-object-inheritance,
113+
unused-variable,
114+
unused-import,
115+
undefined-variable
116+
not-callable,
117+
arguments-differ,
118+
redefined-outer-name
119+
120+
[REPORTS]
121+
122+
# Set the output format. Available formats are text, parseable, colorized, json
123+
# and msvs (visual studio). You can also give a reporter class, e.g.
124+
# mypackage.mymodule.MyReporterClass.
125+
output-format=text
126+
127+
# Tells whether to display a full report or only the messages.
128+
reports=no
129+
130+
# Activate the evaluation score.
131+
score=yes
132+
133+
134+
[LOGGING]
135+
136+
# Format style used to check logging format string. `old` means using %
137+
# formatting, `new` is for `{}` formatting,and `fstr` is for f-strings.
138+
logging-format-style=new
139+
140+
# Logging modules to check that the string format arguments are in logging
141+
# function parameter format.
142+
logging-modules=logging
143+
144+
145+
[VARIABLES]
146+
147+
# List of additional names supposed to be defined in builtins. Remember that
148+
# you should avoid defining new builtins when possible.
149+
additional-builtins=
150+
151+
# Tells whether unused global variables should be treated as a violation.
152+
allow-global-unused-variables=yes
153+
154+
# List of strings which can identify a callback function by name. A callback
155+
# name must start or end with one of those strings.
156+
callbacks=cb_,
157+
_cb
158+
159+
# A regular expression matching the name of dummy variables (i.e. expected to
160+
# not be used).
161+
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
162+
163+
# Argument names that match this expression will be ignored. Default to name
164+
# with leading underscore.
165+
ignored-argument-names=_.*|^ignored_|^unused_
166+
167+
# Tells whether we should check for unused import in __init__ files.
168+
init-import=no
169+
170+
# List of qualified module names which can have objects that can redefine
171+
# builtins.
172+
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
173+
174+
175+
[FORMAT]
176+
177+
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
178+
expected-line-ending-format=
179+
180+
# Regexp for a line that is allowed to be longer than the limit.
181+
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
182+
183+
# Number of spaces of indent required inside a hanging or continued line.
184+
indent-after-paren=4
185+
186+
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
187+
# tab).
188+
indent-string=' '
189+
190+
# Maximum number of characters on a single line.
191+
max-line-length=160
192+
193+
# Maximum number of lines in a module.
194+
max-module-lines=1000
195+
196+
# List of optional constructs for which whitespace checking is disabled. `dict-
197+
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
198+
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
199+
# `empty-line` allows space-only lines.
200+
no-space-check=trailing-comma,
201+
dict-separator
202+
203+
# Allow the body of a class to be on the same line as the declaration if body
204+
# contains single statement.
205+
single-line-class-stmt=no
206+
207+
# Allow the body of an if to be on the same line as the test if there is no
208+
# else.
209+
single-line-if-stmt=no
210+
211+
212+
[BASIC]
213+
214+
# Naming style matching correct argument names.
215+
argument-naming-style=snake_case
216+
217+
# Regular expression matching correct argument names. Overrides argument-
218+
# naming-style.
219+
#argument-rgx=
220+
221+
# Naming style matching correct attribute names.
222+
attr-naming-style=snake_case
223+
224+
# Regular expression matching correct attribute names. Overrides attr-naming-
225+
# style.
226+
#attr-rgx=
227+
228+
# Bad variable names which should always be refused, separated by a comma.
229+
bad-names=foo,
230+
bar,
231+
baz,
232+
toto,
233+
tutu,
234+
tata
235+
236+
# Naming style matching correct class attribute names.
237+
class-attribute-naming-style=any
238+
239+
# Naming style matching correct class names.
240+
class-naming-style=PascalCase
241+
242+
# Minimum line length for functions/classes that require docstrings, shorter
243+
# ones are exempt.
244+
docstring-min-length=-1
245+
246+
# Naming style matching correct function names.
247+
function-naming-style=snake_case
248+
249+
# Good variable names which should always be accepted, separated by a comma.
250+
good-names=i,
251+
j,
252+
k,
253+
ex,
254+
Run,
255+
_
256+
257+
# Include a hint for the correct naming format with invalid-name.
258+
include-naming-hint=no
259+
260+
# Naming style matching correct inline iteration names.
261+
inlinevar-naming-style=any
262+
263+
# Naming style matching correct method names.
264+
method-naming-style=snake_case
265+
266+
# Naming style matching correct module names.
267+
module-naming-style=snake_case
268+
269+
# List of decorators that produce properties, such as abc.abstractproperty. Add
270+
# to this list to register other decorators that produce valid properties.
271+
# These decorators are taken in consideration only for invalid-name.
272+
property-classes=abc.abstractproperty
273+
274+
# Naming style matching correct variable names.
275+
variable-naming-style=snake_case
276+
277+
278+
[STRING]
279+
280+
# This flag controls whether the implicit-str-concat-in-sequence should
281+
# generate a warning on implicit string concatenation in sequences defined over
282+
# several lines.
283+
check-str-concat-over-line-jumps=no
284+
285+
286+
[IMPORTS]
287+
288+
# List of modules that can be imported at any level, not just the top level
289+
# one.
290+
allow-any-import-level=
291+
292+
# Allow wildcard imports from modules that define __all__.
293+
allow-wildcard-with-all=no
294+
295+
# Analyse import fallback blocks. This can be used to support both Python 2 and
296+
# 3 compatible code, which means that the block might have code that exists
297+
# only in one or another interpreter, leading to false positives when analysed.
298+
analyse-fallback-blocks=no
299+
300+
# Deprecated modules which should not be used, separated by a comma.
301+
deprecated-modules=optparse,tkinter.tix
302+
303+
# Create a graph of external dependencies in the given file (report RP0402 must
304+
# not be disabled).
305+
ext-import-graph=
306+
307+
# Create a graph of every (i.e. internal and external) dependencies in the
308+
# given file (report RP0402 must not be disabled).
309+
import-graph=
310+
311+
# Create a graph of internal dependencies in the given file (report RP0402 must
312+
# not be disabled).
313+
int-import-graph=
314+
315+
# Force import order to recognize a module as part of the standard
316+
# compatibility libraries.
317+
known-standard-library=
318+
319+
# Force import order to recognize a module as part of a third party library.
320+
known-third-party=enchant
321+
322+
# Couples of modules and preferred modules, separated by a comma.
323+
preferred-modules=
324+
325+
326+
[CLASSES]
327+
328+
# List of method names used to declare (i.e. assign) instance attributes.
329+
defining-attr-methods=__init__,
330+
__new__,
331+
setUp,
332+
__post_init__
333+
334+
# List of member names, which should be excluded from the protected access
335+
# warning.
336+
exclude-protected=_asdict,
337+
_fields,
338+
_replace,
339+
_source,
340+
_make
341+
342+
# List of valid names for the first argument in a class method.
343+
valid-classmethod-first-arg=cls
344+
345+
# List of valid names for the first argument in a metaclass class method.
346+
valid-metaclass-classmethod-first-arg=cls

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ sort-imports:
4646
check-lint:
4747
@pylint --rcfile=.pylintrc ./redisvl
4848

49+
# help: mypy - run mypy
50+
.PHONY: mypy
51+
mypy:
52+
@mypy ./redisvl
53+
54+
# help:
55+
# help: Documentation
56+
# help: -------
57+
58+
# help: docs - generate project documentation
59+
.PHONY: docs
60+
docs:
61+
@cd doc; make html
4962

5063
# help:
5164
# help: Test

pyproject.toml

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,11 @@ source = ["redisvl"]
2626
ignore_errors = true
2727

2828
[tool.coverage.html]
29-
directory = "htmlcov"
29+
directory = "htmlcov"
30+
31+
# mypy global options:
32+
33+
[tool.mypy]
34+
warn_unused_configs = true
35+
ignore_missing_imports = true
36+

0 commit comments

Comments
 (0)