Skip to content

Commit 39570da

Browse files
committed
use pinecone config provider
change forRoot to register use config in services add WhoAmI in index update config structure
1 parent 2b631a9 commit 39570da

14 files changed

+128
-41
lines changed

lib/interface/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1+
export * from './indexes';
2+
export * from './vectors';
13
export * from './pinecone.config';
2-
export * from './fetch.results';
3-
export * from './index.description';
4-
export * from './index.stats';
5-
export * from './pinecone.config';
6-
export * from './query.results';
7-
export * from './query';

lib/interface/index.description.ts renamed to lib/interface/indexes/index-description-result.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export interface IndexDescription {
1+
export interface IndexDescriptionResult {
22
database: {
33
dimension: number;
44
index_config: {

lib/interface/indexes/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './index-description-result';
2+
export * from './who-am-i-result';
3+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export interface WhoAmIResult {
2+
project_name: string;
3+
user_label: string;
4+
user_name: string;
5+
}

lib/interface/pinecone.config.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1+
export const PINECONE_CONFIG = 'PINECONE_CONFIG';
2+
13
export interface PineconeConfig {
2-
host: string;
4+
environment: string;
5+
project: string;
36
apiKey: string;
7+
index?: string;
48
}
9+
10+
// TODO for async config
11+
// export interface PineconeConfigFactory {
12+
// createPineconeConfig(): Promise<PineconeConfig> | PineconeConfig;
13+
// }
14+
//
15+
// export interface PineconeAsyncConfig
16+
// extends Pick<ModuleMetadata, 'imports'> {
17+
// useFactory?: (
18+
// ...args: any[]
19+
// ) => Promise<PineconeConfig> | PineconeConfig;
20+
// inject?: any[];
21+
// extraProviders?: Provider[];
22+
// }

lib/interface/vectors/fetch.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface Fetch {
2+
ids: string[];
3+
namespace?: string;
4+
}

lib/interface/index.stats.ts renamed to lib/interface/vectors/index-stats-results.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export interface IndexStat {
1+
export interface IndexStatsResult {
22
namespaces: {
33
[key: string]: { vectorCount: number };
44
};

lib/interface/vectors/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export * from './fetch';
2+
export * from './fetch-results';
3+
export * from './index-stats-results';
4+
export * from './query';
5+
export * from './query-results';

0 commit comments

Comments
 (0)