Interactive#21
Merged
Merged
Conversation
Greptile OverviewGreptile SummaryThis PR adds interactive mode to the
The implementation is comprehensive and well-structured, but contains a critical bug where the default model is set to the non-existent Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant CLI as dspy-cli new
participant Interactive as interactive.py
participant ModelUtils as model_utils.py
participant FileSystem as File System
User->>CLI: dspy-cli new
CLI->>Interactive: prompt_project_name()
Interactive->>User: "What is your project name?"
User->>Interactive: "my-project"
CLI->>Interactive: prompt_setup_first_program()
Interactive->>User: "Customize first program?"
User->>Interactive: Yes
CLI->>Interactive: prompt_program_name()
Interactive->>User: "Program name?"
User->>Interactive: "my_program"
CLI->>Interactive: prompt_module_type()
Interactive->>User: "Choose module type (1-6)"
User->>Interactive: "1" (Predict)
CLI->>Interactive: prompt_signature()
Interactive->>User: "Enter signature or '?'"
User->>Interactive: "question -> answer"
Interactive->>Interactive: parse_signature_string()
CLI->>Interactive: prompt_model()
Interactive->>User: "Enter model"
User->>Interactive: "openai/gpt-4o-mini"
CLI->>ModelUtils: parse_model_string()
ModelUtils-->>CLI: {provider, model, full}
CLI->>ModelUtils: detect_api_key(provider)
ModelUtils-->>CLI: (api_key, env_var_name)
CLI->>Interactive: prompt_api_key()
Interactive->>User: "Enter API key or skip"
User->>Interactive: "sk-..."
CLI->>ModelUtils: generate_model_config()
ModelUtils-->>CLI: model_config_dict
CLI->>FileSystem: Create directory structure
CLI->>FileSystem: Write config files (dspy.config.yaml, .env)
CLI->>FileSystem: Write Python code (modules, signatures)
CLI->>FileSystem: Initialize git repo
CLI->>User: "✓ Project created successfully!"
|
|
|
||
| # Prompt for model | ||
| if model is None: | ||
| model = prompt_model(default="openai/gpt-5-mini") |
There was a problem hiding this comment.
syntax: gpt-5-mini doesn't exist, should be gpt-4o-mini
Suggested change
| model = prompt_model(default="openai/gpt-5-mini") | |
| model = prompt_model(default="openai/gpt-4o-mini") |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/dspy_cli/commands/new.py
Line: 149:149
Comment:
**syntax:** `gpt-5-mini` doesn't exist, should be `gpt-4o-mini`
```suggestion
model = prompt_model(default="openai/gpt-4o-mini")
```
How can I resolve this? If you propose a fix, please make it concise.| Model string (e.g., "anthropic/claude-sonnet-4-5") | ||
| """ | ||
| if not default: | ||
| default = "openai/gpt-5-mini" |
There was a problem hiding this comment.
syntax: gpt-5-mini doesn't exist, should be gpt-4o-mini
Suggested change
| default = "openai/gpt-5-mini" | |
| default = "openai/gpt-4o-mini" |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/dspy_cli/utils/interactive.py
Line: 218:218
Comment:
**syntax:** `gpt-5-mini` doesn't exist, should be `gpt-4o-mini`
```suggestion
default = "openai/gpt-4o-mini"
```
How can I resolve this? If you propose a fix, please make it concise.| prompt_signature, | ||
| prompt_model, | ||
| prompt_api_key, | ||
| prompt_api_base, |
There was a problem hiding this comment.
style: prompt_api_base is imported but never used in this file
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/dspy_cli/commands/new.py
Line: 17:17
Comment:
**style:** `prompt_api_base` is imported but never used in this file
How can I resolve this? If you propose a fix, please make it concise.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added interactive
newbehavior, walking users through project and program creation.