Fix documentation link and code formatting
This commit is contained in:
parent
0e4737979c
commit
25774265d3
6 changed files with 32 additions and 27 deletions
|
|
@ -6,9 +6,7 @@ from langchain_community.embeddings.huggingface import HuggingFaceInferenceAPIEm
|
||||||
class HuggingFaceInferenceAPIEmbeddingsComponent(CustomComponent):
|
class HuggingFaceInferenceAPIEmbeddingsComponent(CustomComponent):
|
||||||
display_name = "HuggingFaceInferenceAPIEmbeddings"
|
display_name = "HuggingFaceInferenceAPIEmbeddings"
|
||||||
description = "HuggingFace sentence_transformers embedding models, API version."
|
description = "HuggingFace sentence_transformers embedding models, API version."
|
||||||
documentation = (
|
documentation = "https://github.com/huggingface/text-embeddings-inference"
|
||||||
"https://github.com/huggingface/text-embeddings-inference"
|
|
||||||
)
|
|
||||||
|
|
||||||
def build_config(self):
|
def build_config(self):
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ class QdrantComponent(CustomComponent):
|
||||||
) -> Union[VectorStore, Qdrant, BaseRetriever]:
|
) -> Union[VectorStore, Qdrant, BaseRetriever]:
|
||||||
if documents is None:
|
if documents is None:
|
||||||
from qdrant_client import QdrantClient
|
from qdrant_client import QdrantClient
|
||||||
|
|
||||||
client = QdrantClient(
|
client = QdrantClient(
|
||||||
location=location,
|
location=location,
|
||||||
url=host,
|
url=host,
|
||||||
|
|
@ -72,7 +73,8 @@ class QdrantComponent(CustomComponent):
|
||||||
host=host,
|
host=host,
|
||||||
path=path,
|
path=path,
|
||||||
)
|
)
|
||||||
vs = Qdrant(client=client,
|
vs = Qdrant(
|
||||||
|
client=client,
|
||||||
collection_name=collection_name,
|
collection_name=collection_name,
|
||||||
embeddings=embedding,
|
embeddings=embedding,
|
||||||
search_kwargs=search_kwargs,
|
search_kwargs=search_kwargs,
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@ from loguru import logger
|
||||||
from langflow.api.v1.callback import AsyncStreamingLLMCallbackHandler, StreamingLLMCallbackHandler
|
from langflow.api.v1.callback import AsyncStreamingLLMCallbackHandler, StreamingLLMCallbackHandler
|
||||||
from langflow.processing.process import fix_memory_inputs, format_actions
|
from langflow.processing.process import fix_memory_inputs, format_actions
|
||||||
from langflow.services.deps import get_plugins_service
|
from langflow.services.deps import get_plugins_service
|
||||||
from langflow.processing.process import fix_memory_inputs, format_actions
|
|
||||||
from langflow.services.deps import get_plugins_service
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from langfuse.callback import CallbackHandler # type: ignore
|
from langfuse.callback import CallbackHandler # type: ignore
|
||||||
|
|
|
||||||
|
|
@ -7,16 +7,20 @@ import {
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "../../../ui/dropdown-menu";
|
} from "../../../ui/dropdown-menu";
|
||||||
|
|
||||||
import { useNavigate, useParams } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { Node } from "reactflow";
|
||||||
import FlowSettingsModal from "../../../../modals/flowSettingsModal";
|
import FlowSettingsModal from "../../../../modals/flowSettingsModal";
|
||||||
import useAlertStore from "../../../../stores/alertStore";
|
import useAlertStore from "../../../../stores/alertStore";
|
||||||
|
import useFlowStore from "../../../../stores/flowStore";
|
||||||
import useFlowsManagerStore from "../../../../stores/flowsManagerStore";
|
import useFlowsManagerStore from "../../../../stores/flowsManagerStore";
|
||||||
import IconComponent from "../../../genericIconComponent";
|
import IconComponent from "../../../genericIconComponent";
|
||||||
import { Button } from "../../../ui/button";
|
import { Button } from "../../../ui/button";
|
||||||
import { Node } from "reactflow";
|
|
||||||
import useFlowStore from "../../../../stores/flowStore";
|
|
||||||
|
|
||||||
export const MenuBar = ({removeFunction}: {removeFunction: (nodes: Node[]) => void}): JSX.Element => {
|
export const MenuBar = ({
|
||||||
|
removeFunction,
|
||||||
|
}: {
|
||||||
|
removeFunction: (nodes: Node[]) => void;
|
||||||
|
}): JSX.Element => {
|
||||||
const addFlow = useFlowsManagerStore((state) => state.addFlow);
|
const addFlow = useFlowsManagerStore((state) => state.addFlow);
|
||||||
const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
|
const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
|
||||||
const setErrorData = useAlertStore((state) => state.setErrorData);
|
const setErrorData = useAlertStore((state) => state.setErrorData);
|
||||||
|
|
@ -42,7 +46,7 @@ export const MenuBar = ({removeFunction}: {removeFunction: (nodes: Node[]) => vo
|
||||||
<div className="round-button-div">
|
<div className="round-button-div">
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
removeFunction(n)
|
removeFunction(n);
|
||||||
navigate(-1);
|
navigate(-1);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,11 @@ import AlertDropdown from "../../alerts/alertDropDown";
|
||||||
import { USER_PROJECTS_HEADER } from "../../constants/constants";
|
import { USER_PROJECTS_HEADER } from "../../constants/constants";
|
||||||
import { AuthContext } from "../../contexts/authContext";
|
import { AuthContext } from "../../contexts/authContext";
|
||||||
|
|
||||||
|
import { Node } from "reactflow";
|
||||||
import useAlertStore from "../../stores/alertStore";
|
import useAlertStore from "../../stores/alertStore";
|
||||||
import { useDarkStore } from "../../stores/darkStore";
|
import { useDarkStore } from "../../stores/darkStore";
|
||||||
|
import useFlowStore from "../../stores/flowStore";
|
||||||
|
import useFlowsManagerStore from "../../stores/flowsManagerStore";
|
||||||
import { useStoreStore } from "../../stores/storeStore";
|
import { useStoreStore } from "../../stores/storeStore";
|
||||||
import { gradients } from "../../utils/styleUtils";
|
import { gradients } from "../../utils/styleUtils";
|
||||||
import IconComponent from "../genericIconComponent";
|
import IconComponent from "../genericIconComponent";
|
||||||
|
|
@ -21,9 +24,6 @@ import {
|
||||||
} from "../ui/dropdown-menu";
|
} from "../ui/dropdown-menu";
|
||||||
import { Separator } from "../ui/separator";
|
import { Separator } from "../ui/separator";
|
||||||
import MenuBar from "./components/menuBar";
|
import MenuBar from "./components/menuBar";
|
||||||
import useFlowsManagerStore from "../../stores/flowsManagerStore";
|
|
||||||
import useFlowStore from "../../stores/flowStore";
|
|
||||||
import { Node } from "reactflow";
|
|
||||||
|
|
||||||
export default function Header(): JSX.Element {
|
export default function Header(): JSX.Element {
|
||||||
const notificationCenter = useAlertStore((state) => state.notificationCenter);
|
const notificationCenter = useAlertStore((state) => state.notificationCenter);
|
||||||
|
|
@ -32,7 +32,7 @@ export default function Header(): JSX.Element {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const removeFlow = useFlowsManagerStore((store) => store.removeFlow);
|
const removeFlow = useFlowsManagerStore((store) => store.removeFlow);
|
||||||
const hasStore = useStoreStore((state) => state.hasStore);
|
const hasStore = useStoreStore((state) => state.hasStore);
|
||||||
const {id} = useParams();
|
const { id } = useParams();
|
||||||
const n = useFlowStore((state) => state.nodes);
|
const n = useFlowStore((state) => state.nodes);
|
||||||
|
|
||||||
const dark = useDarkStore((state) => state.dark);
|
const dark = useDarkStore((state) => state.dark);
|
||||||
|
|
@ -50,7 +50,7 @@ export default function Header(): JSX.Element {
|
||||||
|
|
||||||
async function checkForChanges(nodes: Node[]): Promise<void> {
|
async function checkForChanges(nodes: Node[]): Promise<void> {
|
||||||
if (nodes.length === 0) {
|
if (nodes.length === 0) {
|
||||||
await removeFlow(id!)
|
await removeFlow(id!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,7 +73,9 @@ export default function Header(): JSX.Element {
|
||||||
: "secondary"
|
: "secondary"
|
||||||
}
|
}
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => {checkForChanges(n)}}
|
onClick={() => {
|
||||||
|
checkForChanges(n);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<IconComponent name="Home" className="h-4 w-4" />
|
<IconComponent name="Home" className="h-4 w-4" />
|
||||||
<div className="hidden flex-1 md:block">{USER_PROJECTS_HEADER}</div>
|
<div className="hidden flex-1 md:block">{USER_PROJECTS_HEADER}</div>
|
||||||
|
|
@ -97,7 +99,9 @@ export default function Header(): JSX.Element {
|
||||||
className="gap-2"
|
className="gap-2"
|
||||||
variant={location.pathname === "/store" ? "primary" : "secondary"}
|
variant={location.pathname === "/store" ? "primary" : "secondary"}
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => {checkForChanges(n)}}
|
onClick={() => {
|
||||||
|
checkForChanges(n);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<IconComponent name="Store" className="h-4 w-4" />
|
<IconComponent name="Store" className="h-4 w-4" />
|
||||||
<div className="flex-1">Store</div>
|
<div className="flex-1">Store</div>
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ import {
|
||||||
createRandomKey,
|
createRandomKey,
|
||||||
getFieldTitle,
|
getFieldTitle,
|
||||||
getRandomDescription,
|
getRandomDescription,
|
||||||
getRandomName,
|
|
||||||
toTitleCase,
|
toTitleCase,
|
||||||
} from "./utils";
|
} from "./utils";
|
||||||
const uid = new ShortUniqueId({ length: 5 });
|
const uid = new ShortUniqueId({ length: 5 });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue