Skip to content

Commit

Permalink
Config support for Pinecone (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
cybermaggedon authored Nov 28, 2024
1 parent dfe2a76 commit 4f7faed
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/simple-editor/deployment/ConfigGeneration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ const ConfigGeneration = () => {
return (
<>


<Box>
<Paper sx={{ minWidth: 375, mt: 2, p: 2 }} elevation={3}>
<Stack
Expand Down
5 changes: 5 additions & 0 deletions src/simple-editor/deployment/Deployment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import DeploymentPlatform from './DeploymentPlatform';
import DeploymentModel from './DeploymentModel';
import DeploymentConfig from './DeploymentConfig';
import DeploymentInstructions from './DeploymentInstructions';
import DeploymentVectorStore from './DeploymentVectorStore';

interface DeploymentProps {
}
Expand All @@ -30,6 +31,10 @@ const Deployment: React.FC<DeploymentProps> = ({
<DeploymentModel/>
</Box>

<Box>
<DeploymentVectorStore/>
</Box>

<Box>
<DeploymentConfig/>
</Box>
Expand Down
85 changes: 85 additions & 0 deletions src/simple-editor/deployment/DeploymentVectorStore.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

import React from 'react';

import { Typography, Box, Paper, Stack } from '@mui/material';
import { Polyline } from '@mui/icons-material';

import { useModelParamsStore } from '../state/ModelParams';

import DeploymentEnvVars from './DeploymentEnvVars';
import DeploymentCode from './DeploymentCode';

const VectorStoreConfiguration = () => {
const platform = useModelParamsStore((state) => state.platform);

if ((platform == "podman-compose") || platform == "docker-compose") {

return <>

<Typography variant="body2" sx={{ mt: 2 }}>
To use Pinecone, you you need an API token which must
be provided in an environment variable. The API token
can be created in the Pinecone console of your account.
</Typography>

<DeploymentEnvVars
variables={[
{
name: "PINECONE_API_KEY",
value: "TOKEN-GOES-HERE"
}
]}
/>

</>;

} else {

return <>

<Typography variant="body2" sx={{ mt: 2 }}>
To use Pinecone, you you need an API token which must
be provided in a Kubernetes secret.
</Typography>

<DeploymentCode>
kubectl -n trustgraph create secret \<br/>
{' '}generic pinecone-api-key \<br/>
{' '}--from-literal=pinecone-api-key=<span className="variable">PINECONE-API-KEY</span>
</DeploymentCode>
</>;

}

}

const DeploymentModelVector: React.FC<{}> = ({
}) => {

const vectorDB = useModelParamsStore((state) => state.vectorDB);

if (vectorDB != "pinecone") return null;

return <>

<Box>
<Paper sx={{ minWidth: 375, mt: 2, p: 2 }} elevation={3}>
<Stack
direction="row" spacing={2}
alignItems="center"
>
<Polyline color="primary" fontSize="large"/>
<Typography variant="h6" component="h3">
<Box>Vector Store configuration</Box>
</Typography>
</Stack>
<VectorStoreConfiguration/>
</Paper>
</Box>

</>;

};

export default DeploymentModelVector;

0 comments on commit 4f7faed

Please sign in to comment.