Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI / Readme - update docs links #645

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ client.get_extracted_content(content_id)
```

### LLM Framework Integration
Indexify can work with any LLM framework, or with your applications directly. We have an example of a Langchain application [here](https://getindexify.ai/integrations/langchain/python_langchain/) and DSPy [here](https://docs.getindexify.ai/integrations/dspy/python_dspy/).
Indexify can work with any LLM framework, or with your applications directly. We have an example of a Langchain application [here](https://docs.getindexify.ai/integrations/langchain/python_langchain/) and DSPy [here](https://docs.getindexify.ai/integrations/dspy/python_dspy/).

### Try out other extractors
We have a ton of other extractors, you can list them and try them out -
Expand All @@ -217,7 +217,7 @@ Any extraction or transformation algorithm can be expressed as an Indexify Extra
Extractors which produce structured data from content, such as bounding boxes and object type, or line items of invoices are stored in
structured store. You can query extracted structured data using Indexify's SQL interface.

We have an example [here](https://getindexify.ai/usecases/image_retrieval/)
We have an example [here](https://docs.getindexify.ai/usecases/image_retrieval/)

## Contributions
Please open an issue to discuss new features, or join our Discord group. Contributions are welcome, there are a bunch of open tasks we could use help with!
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/extractor_cli.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Command Line Interface

Indexify has two CLIs, `indexify-extractor` for running and testing the Extractors. And a CLI to run the server. If you want to learn about the CLI interface of the server, please read (Operating Indexify)[https://getindexify.ai/configuration/]
Indexify has two CLIs, `indexify-extractor` for running and testing the Extractors. And a CLI to run the server. If you want to learn about the CLI interface of the server, please read (Operating Indexify)[https://docs.getindexify.ai/configuration/]

## Indexify Extractor CLI

Expand Down
112 changes: 55 additions & 57 deletions ui/src/components/ExtractionGraphs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,66 @@ import {
IExtractionPolicy,
IExtractor,
ITask,
} from "getindexify";
import { Alert, IconButton, Typography } from "@mui/material";
import { Box, Stack } from "@mui/system";
import React, { ReactElement } from "react";
import GavelIcon from "@mui/icons-material/Gavel";
import InfoIcon from "@mui/icons-material/Info";
import ExtractionPolicyItem from "./ExtractionPolicyItem";
import { IExtractionGraphCol, IExtractionGraphColumns } from "../types";
import CopyText from "./CopyText";
} from 'getindexify'
import { Alert, IconButton, Typography } from '@mui/material'
import { Box, Stack } from '@mui/system'
import React, { ReactElement } from 'react'
import GavelIcon from '@mui/icons-material/Gavel'
import InfoIcon from '@mui/icons-material/Info'
import ExtractionPolicyItem from './ExtractionPolicyItem'
import { IExtractionGraphCol, IExtractionGraphColumns } from '../types'
import CopyText from './CopyText'

const ExtractionGraphs = ({
extractionGraphs,
namespace,
extractors,
tasks,
}: {
extractionGraphs: IExtractionGraph[];
namespace: string;
extractors: IExtractor[];
tasks: ITask[];
extractionGraphs: IExtractionGraph[]
namespace: string
extractors: IExtractor[]
tasks: ITask[]
}) => {
const itemheight = 60;
const itemheight = 60
const cols: IExtractionGraphColumns = {
name: { displayName: "Name", width: 350 },
extractor: { displayName: "Extractor", width: 225 },
mimeTypes: { displayName: "Input MimeTypes", width: 225 },
inputParams: { displayName: "Input Parameters", width: 225 },
taskCount: { displayName: "Tasks", width: 75 },
};
name: { displayName: 'Name', width: 350 },
extractor: { displayName: 'Extractor', width: 225 },
mimeTypes: { displayName: 'Input MimeTypes', width: 225 },
inputParams: { displayName: 'Input Parameters', width: 225 },
taskCount: { displayName: 'Tasks', width: 75 },
}

const renderHeader = () => {
return (
<Stack
direction={"row"}
direction={'row'}
px={2}
py={2}
sx={{
width: "100%",
borderBottom: "1px solid #e5e5e5",
width: '100%',
borderBottom: '1px solid #e5e5e5',
}}
>
{Object.values(cols).map((col: IExtractionGraphCol) => {
return (
<Box key={col.displayName} minWidth={`${col.width}px`}>
<Typography variant="label">{col.displayName}</Typography>
</Box>
);
)
})}
</Stack>
);
};
)
}

const renderGraphItems = (
policies: IExtractionPolicy[],
source: string,
depth = 0
): ReactElement[] => {
let items: ReactElement[] = [];
let items: ReactElement[] = []
// use sibling count to keep track of how many are above
let siblingCount = items.length;
let siblingCount = items.length
policies
.filter((policy) => policy.content_source === source)
.forEach((policy, i) => {
Expand All @@ -78,13 +78,13 @@ const ExtractionGraphs = ({
siblingCount={siblingCount}
itemHeight={itemheight}
/>
);
const children = renderGraphItems(policies, policy.name, depth + 1);
items = items.concat(children);
siblingCount = children.length;
});
return items;
};
)
const children = renderGraphItems(policies, policy.name, depth + 1)
items = items.concat(children)
siblingCount = children.length
})
return items
}

const renderContent = () => {
if (extractionGraphs.length === 0) {
Expand All @@ -94,50 +94,48 @@ const ExtractionGraphs = ({
No Graphs Found
</Alert>
</Box>
);
)
}

return (
<Box
sx={{
width: "100%",
overflow: "auto",
border: "1px solid rgba(224, 224, 224, 1);",
borderRadius: "5px",
backgroundColor: "white",
width: '100%',
overflow: 'auto',
border: '1px solid rgba(224, 224, 224, 1);',
borderRadius: '5px',
backgroundColor: 'white',
}}
>
<div style={{ minWidth: "max-content" }}>{renderHeader()}</div>
<div style={{ minWidth: 'max-content' }}>{renderHeader()}</div>
{extractionGraphs.map((graph) => {
return (
<Box key={graph.name} sx={{ p: 2 }}>
<Box display="flex" alignItems={"center"}>
<Typography variant="h3">
{graph.name}
</Typography>
<Box display="flex" alignItems={'center'}>
<Typography variant="h3">{graph.name}</Typography>
<CopyText text={graph.name} />
</Box>
{renderGraphItems(graph.extraction_policies, "")}
{renderGraphItems(graph.extraction_policies, '')}
</Box>
);
)
})}
</Box>
);
};
)
}

return (
<>
<Stack
display={"flex"}
direction={"row"}
alignItems={"center"}
display={'flex'}
direction={'row'}
alignItems={'center'}
spacing={2}
>
<GavelIcon />
<Typography variant="h3">
Extraction Graphs
<IconButton
href="https://getindexify.ai/concepts/#extraction-graphs"
href="https://docs.getindexify.ai/concepts/#extraction-graphs"
target="_blank"
>
<InfoIcon fontSize="small" />
Expand All @@ -146,7 +144,7 @@ const ExtractionGraphs = ({
</Stack>
{renderContent()}
</>
);
};
)
}

export default ExtractionGraphs;
export default ExtractionGraphs
Loading
Loading