Skip to content

Commit

Permalink
Show pinecone status on start
Browse files Browse the repository at this point in the history
  • Loading branch information
firtoz committed Jan 6, 2023
1 parent 802e46c commit f9afd69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/pinecone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const getPineconeClient: () => Promise<PineconeClient<PineconeMetadata> |
pineconeClientCache = testClient;
logMessage('Successfully created pinecone client!');
} catch (e) {
logMessage('Cannot create pinecone client...');
logMessage('Cannot create pinecone client...', e);
pineconeClientCache = null;
}
} else {
Expand Down Expand Up @@ -78,6 +78,8 @@ export const trySavingPineconeOptions = async (options: PineconeConfigOpts | nul
config.pineconeOptions = options;
await setConfig(config);

logMessage('Successfully created pinecone client!');

return {
success: true,
};
Expand Down
3 changes: 3 additions & 0 deletions src/discord/listeners/ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {getEnv} from "../../utils/GetEnv";
import {ConfigType, getConfig, getConfigForId, ConfigForIdType} from "../../core/config";
import {mainServerId} from "../../core/MainServerId";
import {getOpenAIForId} from "../../core/GetOpenAIForId";
import {getPineconeClient} from "../../core/pinecone";


async function checkUsage(config: ConfigForIdType) {
Expand Down Expand Up @@ -107,6 +108,8 @@ export default (client: Client): void => {

// await checkUsage(config);

await getPineconeClient();

StartListeningToMessages(client);
InitializeThreads();
});
Expand Down

0 comments on commit f9afd69

Please sign in to comment.