@@ -105,12 +105,12 @@ func ProcessEmbeddingBatch(ctx context.Context, dataBatch []map[string]interface
105105
106106// EmbeddingConfig holds configuration for the embedding creation process
107107type EmbeddingConfig struct {
108- ModelName string
109- InputFile string
110- OutputFile string
111- FieldToEmbed string
112- EmbeddedField string
113- BatchSize int
108+ ModelName string
109+ DataWithoutVectors string
110+ DataWithVectors string
111+ FieldToEmbed string
112+ EmbeddedField string
113+ BatchSize int
114114}
115115
116116// LoadEmbeddingConfig loads configuration from environment variables
@@ -124,12 +124,12 @@ func LoadEmbeddingConfig() *EmbeddingConfig {
124124 batchSize , _ := strconv .Atoi (getEnvOrDefault ("EMBEDDING_SIZE_BATCH" , "16" ))
125125
126126 return & EmbeddingConfig {
127- ModelName : getEnvOrDefault ("AZURE_OPENAI_EMBEDDING_MODEL" , "text-embedding-ada-002" ),
128- InputFile : getEnvOrDefault ("DATA_FILE_WITHOUT_VECTORS" , "data/HotelsData_toCosmosDB_Vector .json" ),
129- OutputFile : getEnvOrDefault ("DATA_FILE_WITH_VECTORS" , "data/HotelsData_with_vectors .json" ),
130- FieldToEmbed : getEnvOrDefault ("FIELD_TO_EMBED" , "Description" ),
131- EmbeddedField : getEnvOrDefault ("EMBEDDED_FIELD" , "DescriptionVector" ),
132- BatchSize : batchSize ,
127+ ModelName : getEnvOrDefault ("AZURE_OPENAI_EMBEDDING_MODEL" , "text-embedding-ada-002" ),
128+ DataWithoutVectors : getEnvOrDefault ("DATA_FILE_WITHOUT_VECTORS" , "HotelsData_toCosmosDB .json" ),
129+ DataWithVectors : getEnvOrDefault ("DATA_FILE_WITH_VECTORS" , "data/HotelsData_toCosmosDB_Vector .json" ),
130+ FieldToEmbed : getEnvOrDefault ("FIELD_TO_EMBED" , "Description" ),
131+ EmbeddedField : getEnvOrDefault ("EMBEDDED_FIELD" , "DescriptionVector" ),
132+ BatchSize : batchSize ,
133133 }
134134}
135135
@@ -149,8 +149,8 @@ func main() {
149149 config := LoadEmbeddingConfig ()
150150
151151 fmt .Printf ("Configuration:\n " )
152- fmt .Printf (" Input file: %s\n " , config .InputFile )
153- fmt .Printf (" Output file: %s\n " , config .OutputFile )
152+ fmt .Printf (" Input file: %s\n " , config .DataWithoutVectors )
153+ fmt .Printf (" Output file: %s\n " , config .DataWithVectors )
154154 fmt .Printf (" Field to embed: %s\n " , config .FieldToEmbed )
155155 fmt .Printf (" Embedding field: %s\n " , config .EmbeddedField )
156156 fmt .Printf (" Batch size: %d\n " , config .BatchSize )
@@ -169,8 +169,8 @@ func main() {
169169 }()
170170
171171 // Read the input data file
172- fmt .Printf ("\n Reading input data from %s...\n " , config .InputFile )
173- data , err := ReadFileReturnJSON (config .InputFile )
172+ fmt .Printf ("\n Reading input data from %s...\n " , config .DataWithoutVectors )
173+ data , err := ReadFileReturnJSON (config .DataWithoutVectors )
174174 if err != nil {
175175 log .Fatalf ("Failed to read input file: %v" , err )
176176 }
@@ -212,8 +212,8 @@ func main() {
212212 }
213213
214214 // Save the enhanced data with embeddings
215- fmt .Printf ("\n Saving enhanced data to %s...\n " , config .OutputFile )
216- err = WriteFileJSON (data , config .OutputFile )
215+ fmt .Printf ("\n Saving enhanced data to %s...\n " , config .DataWithVectors )
216+ err = WriteFileJSON (data , config .DataWithVectors )
217217 if err != nil {
218218 log .Fatalf ("Failed to save output file: %v" , err )
219219 }
0 commit comments