Skip to content

Commit eb35b60

Browse files
authored
[deploy] Merge pull request #197 from microsoft/dev
python3.9 support and fix issues with gpt-5.1
2 parents 4b397f4 + 8f101d4 commit eb35b60

5 files changed

Lines changed: 190 additions & 363 deletions

File tree

py-src/data_formulator/agents/agent_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,13 @@ def assemble_table_summary(input_table, idx):
234234
return summary_str
235235

236236
table_summaries = [assemble_table_summary(input_table, i) for i, input_table in enumerate(input_tables)]
237-
237+
238+
# Join with newline (extracted from f-string for Python 3.9/3.10 compatibility)
239+
joined_summaries = '\n'.join(table_summaries)
240+
238241
full_summary = f'''Here are our datasets, here are their summaries and samples:
239242
240-
{'\n'.join(table_summaries)}
243+
{joined_summaries}
241244
'''
242245

243246
return full_summary

py-src/data_formulator/agents/client_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def get_completion(self, messages, stream=False):
112112
}
113113

114114
if self.model.startswith("gpt-5") or self.model.startswith("o1") or self.model.startswith("o3"):
115-
completion_params["reasoning_effort"] = "minimal"
115+
completion_params["reasoning_effort"] = "low"
116116

117117
return client.chat.completions.create(**completion_params, stream=stream)
118118
else:

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "data_formulator"
7-
version = "0.5.0.1"
7+
version = "0.5.0.2"
88

9-
requires-python = ">=3.12"
9+
requires-python = ">=3.9"
1010
authors = [
1111
{name = "Chenglong Wang", email = "chenglong.wang@microsoft.com"},
1212
{name = "Dan Marshall", email = "danmar@microsoft.com"},

src/views/About.tsx

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT License.
33

44
import { Box, Typography, Button, useTheme, alpha, IconButton, Divider } from "@mui/material";
5-
import React, { FC, useState, useEffect } from "react";
5+
import React, { FC, useState, useEffect, useRef } from "react";
66
import ArrowBackIosNewIcon from '@mui/icons-material/ArrowBackIosNew';
77
import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
88
import GridViewIcon from '@mui/icons-material/GridView';
@@ -62,6 +62,8 @@ export const About: FC<{}> = function About({ }) {
6262
const theme = useTheme();
6363
const [currentFeature, setCurrentFeature] = useState(0);
6464
const [currentScreenshot, setCurrentScreenshot] = useState(0);
65+
const videoRef = useRef<HTMLVideoElement | null>(null);
66+
const videoDurationsRef = useRef<Map<string, number>>(new Map());
6567

6668
const handlePrevious = () => {
6769
setCurrentFeature((prev) => (prev === 0 ? features.length - 1 : prev - 1));
@@ -71,6 +73,27 @@ export const About: FC<{}> = function About({ }) {
7173
setCurrentFeature((prev) => (prev === features.length - 1 ? 0 : prev + 1));
7274
};
7375

76+
// Auto-advance features based on video duration
77+
useEffect(() => {
78+
const currentMedia = features[currentFeature].media;
79+
const isVideo = features[currentFeature].mediaType === 'video';
80+
81+
// Default duration for images or if video duration is not yet loaded
82+
let duration = 10000; // 10 seconds for images
83+
84+
if (isVideo && videoDurationsRef.current.has(currentMedia)) {
85+
// Use the stored video duration (in milliseconds)
86+
duration = videoDurationsRef.current.get(currentMedia)! * 1000;
87+
duration = duration + 3000; // add 3 seconds to the video duration
88+
}
89+
90+
const timeoutId = setTimeout(() => {
91+
setCurrentFeature((prev) => (prev + 1) % features.length);
92+
}, duration);
93+
94+
return () => clearTimeout(timeoutId);
95+
}, [currentFeature]);
96+
7497
// Preload adjacent carousel items for smoother transitions
7598
useEffect(() => {
7699
const preloadMedia = (index: number) => {
@@ -133,11 +156,26 @@ export const About: FC<{}> = function About({ }) {
133156
href="https://pypi.org/project/data-formulator/"
134157
>Install Locally</Button>
135158
<Button size="large" variant="outlined" color="primary"
159+
sx={{
160+
animation: 'subtleGlow 2s ease-in-out infinite',
161+
'@keyframes subtleGlow': {
162+
'0%, 100%': {
163+
boxShadow: `0 0 8px ${alpha(theme.palette.primary.main, 0.4)}, 0 0 16px ${alpha(theme.palette.primary.main, 0.2)}`,
164+
},
165+
'50%': {
166+
boxShadow: `0 0 12px ${alpha(theme.palette.primary.main, 0.6)}, 0 0 24px ${alpha(theme.palette.primary.main, 0.3)}, 0 0 32px ${alpha(theme.palette.primary.main, 0.1)}`,
167+
}
168+
},
169+
'&:hover': {
170+
animation: 'subtleGlow 1.5s ease-in-out infinite',
171+
boxShadow: `0 0 16px ${alpha(theme.palette.primary.main, 0.7)}, 0 0 32px ${alpha(theme.palette.primary.main, 0.4)} !important`,
172+
}
173+
}}
136174
startIcon={<GridViewIcon sx={{ fontSize: '1rem' }} />}
137175
href="/app"
138-
>Online Demo</Button>
176+
>Try Online Demo</Button>
139177
<Typography variant="caption" sx={{ mt: 1.5, color: 'text.secondary', fontStyle: 'italic' }}>
140-
Psst — install locally for the full experience ✨. The online demo is a bit slow & has limited features (at the moment).
178+
Psst — install locally for the full experience ✨. The online demo has limited features (at the moment).
141179
</Typography>
142180
</Box>
143181
);
@@ -290,11 +328,21 @@ export const About: FC<{}> = function About({ }) {
290328
component="video"
291329
key={features[currentFeature].media}
292330
src={features[currentFeature].media}
331+
ref={videoRef}
293332
autoPlay
294333
loop
295334
muted
296335
playsInline
297336
preload="metadata"
337+
onLoadedMetadata={(e) => {
338+
const video = e.currentTarget as HTMLVideoElement;
339+
if (video.duration && !isNaN(video.duration)) {
340+
videoDurationsRef.current.set(
341+
features[currentFeature].media,
342+
video.duration
343+
);
344+
}
345+
}}
298346
sx={{
299347
width: '100%',
300348
height: 'auto',

0 commit comments

Comments
 (0)