-
Notifications
You must be signed in to change notification settings - Fork 153
Expand file tree
/
Copy path__init__.py
More file actions
60 lines (47 loc) · 2.06 KB
/
Copy path__init__.py
File metadata and controls
60 lines (47 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Turn of isort, because alphabetic order for the following imports causes circular dependency issues
from importlib.metadata import version
import os
api_key = os.environ.get("LAMINI_API_KEY", None)
api_url = os.environ.get("LAMINI_API_URL", None)
MISSING_API_KEY_MESSAGE = """LAMINI_API_KEY not found.
Please set it as an environment variable LAMINI_API_KEY, set it as lamini.api_key, or set it in ~/.lamini/configure.yaml
Find your LAMINI_API_KEY at https://app.lamini.ai/account"""
# When inference call failed, how much retry should we perform.
retry_limit = int(os.environ.get("LAMINI_RETRY_LIMIT", 3))
max_workers = int(os.environ.get("LAMINI_MAX_WORKERS", 4))
batch_size = int(os.environ.get("LAMINI_BATCH_SIZE", 5))
static_batching = bool(os.environ.get("LAMINI_STATIC_BATCHING", True))
bypass_reservation = bool(os.environ.get("LAMINI_BYPASS_RESERVATION", True))
gate_pipeline_batch_completions = bool(
os.environ.get("GATE_PIPELINE_BATCH_COMPLETIONS", True)
)
__version__ = version("lamini")
# isort: off
from lamini.api.lamini import Lamini
from lamini.api.classifier import Classifier
from lamini.api.embedding import Embedding
from lamini.api.model_downloader import ModelDownloader, ModelType, DownloadedModel
from lamini.api.streaming_completion import StreamingCompletion
from lamini.api.memory_rag import MemoryRAG
from lamini.api.openai_client import BaseOpenAIClient
from lamini.generation.generation_node import GenerationNode
from lamini.generation.generation_pipeline import GenerationPipeline
from lamini.generation.base_prompt_object import PromptObject
from lamini.generation.split_response_node import SplitResponseNode
from lamini.index.lamini_index import LaminiIndex
from lamini.experiment.generators import (
QuestionToConceptGenerator,
ConceptToSQLInterpretationGenerator,
QuestionsToConceptsGenerator,
SchemaToSQLGenerator,
SQLDebuggerGenerator,
SaveGenerator,
)
from lamini.experiment.validators import (
FactualityValidator,
SQLValidator,
SQLScoreValidator,
)
from lamini.experiment.utils import (
remove_non_ascii,
)