mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-20 13:54:48 +00:00
[Community][minor]: Added langchain_version while calling discover API (#24428)
- **Description:** Added langchain version while calling discover API during both ingestion and retrieval - **Issue:** NA - **Dependencies:** NA - **Tests:** NA - **Docs** NA --------- Co-authored-by: dristy.cd <dristy@clouddefense.io>
This commit is contained in:
parent
fbb4761199
commit
7205057c3e
@ -6,6 +6,7 @@ against a vector database.
|
|||||||
import datetime
|
import datetime
|
||||||
import inspect
|
import inspect
|
||||||
import logging
|
import logging
|
||||||
|
from importlib.metadata import version
|
||||||
from typing import Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
from langchain.chains.base import Chain
|
from langchain.chains.base import Chain
|
||||||
@ -27,6 +28,7 @@ from langchain_community.chains.pebblo_retrieval.models import (
|
|||||||
App,
|
App,
|
||||||
AuthContext,
|
AuthContext,
|
||||||
ChainInfo,
|
ChainInfo,
|
||||||
|
Framework,
|
||||||
Model,
|
Model,
|
||||||
SemanticContext,
|
SemanticContext,
|
||||||
VectorDB,
|
VectorDB,
|
||||||
@ -327,6 +329,10 @@ class PebbloRetrievalQA(Chain):
|
|||||||
framework=framework,
|
framework=framework,
|
||||||
chains=chains,
|
chains=chains,
|
||||||
plugin_version=PLUGIN_VERSION,
|
plugin_version=PLUGIN_VERSION,
|
||||||
|
client_version=Framework(
|
||||||
|
name="langchain_community",
|
||||||
|
version=version("langchain_community"),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
@ -123,6 +123,7 @@ class App(BaseModel):
|
|||||||
framework: Framework
|
framework: Framework
|
||||||
chains: List[ChainInfo]
|
chains: List[ChainInfo]
|
||||||
plugin_version: str
|
plugin_version: str
|
||||||
|
client_version: Framework
|
||||||
|
|
||||||
|
|
||||||
class Context(BaseModel):
|
class Context(BaseModel):
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
from importlib.metadata import version
|
||||||
from typing import Dict, Iterator, List, Optional
|
from typing import Dict, Iterator, List, Optional
|
||||||
|
|
||||||
from langchain_core.documents import Document
|
from langchain_core.documents import Document
|
||||||
@ -12,6 +13,7 @@ from langchain_community.utilities.pebblo import (
|
|||||||
BATCH_SIZE_BYTES,
|
BATCH_SIZE_BYTES,
|
||||||
PLUGIN_VERSION,
|
PLUGIN_VERSION,
|
||||||
App,
|
App,
|
||||||
|
Framework,
|
||||||
IndexedDocument,
|
IndexedDocument,
|
||||||
PebbloLoaderAPIWrapper,
|
PebbloLoaderAPIWrapper,
|
||||||
generate_size_based_batches,
|
generate_size_based_batches,
|
||||||
@ -175,6 +177,10 @@ class PebbloSafeLoader(BaseLoader):
|
|||||||
runtime=runtime,
|
runtime=runtime,
|
||||||
framework=framework,
|
framework=framework,
|
||||||
plugin_version=PLUGIN_VERSION,
|
plugin_version=PLUGIN_VERSION,
|
||||||
|
client_version=Framework(
|
||||||
|
name="langchain_community",
|
||||||
|
version=version("langchain_community"),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
@ -129,6 +129,8 @@ class App(BaseModel):
|
|||||||
"""Framework details of the app."""
|
"""Framework details of the app."""
|
||||||
plugin_version: str
|
plugin_version: str
|
||||||
"""Plugin version used for the app."""
|
"""Plugin version used for the app."""
|
||||||
|
client_version: Framework
|
||||||
|
"""Client version used for the app."""
|
||||||
|
|
||||||
|
|
||||||
class Doc(BaseModel):
|
class Doc(BaseModel):
|
||||||
|
Loading…
Reference in New Issue
Block a user