@@ -96,71 +96,6 @@ func (c *OllamaClient) GenerateBasic(ctx context.Context, spec *types.Specificat
9696 return records , nil
9797}
9898
99- // generateDemoData generates realistic demo data without requiring Ollama
100- func (c * OllamaClient ) generateDemoData (spec * types.Specification , count int ) []types.Record {
101- records := make ([]types.Record , 0 , count )
102-
103- // Sample realistic data for medical/healthcare domain
104- firstNames := []string {"John" , "Jane" , "Michael" , "Sarah" , "David" , "Lisa" , "Robert" , "Emily" , "James" , "Ashley" }
105- lastNames := []string {"Smith" , "Johnson" , "Williams" , "Brown" , "Jones" , "Garcia" , "Miller" , "Davis" , "Rodriguez" , "Martinez" }
106-
107- for i := 0 ; i < count ; i ++ {
108- record := make (types.Record )
109-
110- for _ , field := range spec .Dataset .Fields {
111- switch field .Type {
112- case "string" :
113- if field .Pattern != "" {
114- record [field .Name ] = c .generatePatternString (field .Pattern , i )
115- } else if field .Name == "first_name" {
116- record [field .Name ] = firstNames [i % len (firstNames )]
117- } else if field .Name == "last_name" {
118- record [field .Name ] = lastNames [i % len (lastNames )]
119- } else {
120- record [field .Name ] = fmt .Sprintf ("sample_%s_%d" , field .Name , i )
121- }
122- case "email" :
123- record [
field .
Name ]
= fmt .
Sprintf (
"%s.%[email protected] " ,
124- firstNames [i % len (firstNames )], lastNames [i % len (lastNames )])
125- case "integer" :
126- if len (field .Range ) == 2 {
127- record [field .Name ] = field .Range [0 ] + (i % (field .Range [1 ] - field .Range [0 ]))
128- } else {
129- record [field .Name ] = i + 1
130- }
131- case "float" :
132- if len (field .Range ) == 2 {
133- baseValue := float64 (field .Range [0 ])
134- rangeSize := float64 (field .Range [1 ] - field .Range [0 ])
135- record [field .Name ] = baseValue + (float64 (i % 100 )/ 100.0 )* rangeSize
136- } else {
137- record [field .Name ] = float64 (i ) * 10.5
138- }
139- case "boolean" :
140- record [field .Name ] = i % 2 == 0
141- case "enum" :
142- if len (field .Values ) > 0 {
143- record [field .Name ] = field .Values [i % len (field .Values )]
144- }
145- case "date" :
146- // Generate dates in the past 30 years
147- baseDate := time .Now ().AddDate (- 30 , 0 , 0 )
148- daysToAdd := i * 365 // Spread across years
149- record [field .Name ] = baseDate .AddDate (0 , 0 , daysToAdd ).Format ("2006-01-02" )
150- case "datetime" :
151- record [field .Name ] = time .Now ().Add (- time .Duration (i ) * time .Hour ).Format (time .RFC3339 )
152- case "array" :
153- record [field .Name ] = []string {fmt .Sprintf ("item_%d_1" , i ), fmt .Sprintf ("item_%d_2" , i )}
154- default :
155- record [field .Name ] = fmt .Sprintf ("sample_%s_%d" , field .Type , i )
156- }
157- }
158-
159- records = append (records , record )
160- }
161-
162- return records
163- }
16499
165100// generatePatternString generates a string that matches a regex pattern
166101func (c * OllamaClient ) generatePatternString (pattern string , seed int ) string {
0 commit comments