-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Update OpenAPI Specification for Ideogram API with New Properties and Schemas #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -506,6 +506,8 @@ components: | |||||||||||||||||
| $ref: '#/components/schemas/ModelEnum' | ||||||||||||||||||
| magic_prompt_option: | ||||||||||||||||||
| $ref: '#/components/schemas/MagicPromptOption' | ||||||||||||||||||
| num_images: | ||||||||||||||||||
| $ref: '#/components/schemas/NumImages' | ||||||||||||||||||
| seed: | ||||||||||||||||||
| $ref: '#/components/schemas/Seed' | ||||||||||||||||||
| style_type: | ||||||||||||||||||
|
|
@@ -646,6 +648,12 @@ components: | |||||||||||||||||
| type: string | ||||||||||||||||||
| description: Description of what to exclude from an image. Descriptions in the prompt take precedence to descriptions in the negative prompt. | ||||||||||||||||||
| example: 'brush strokes, painting' | ||||||||||||||||||
| num_images: | ||||||||||||||||||
| title: num_images | ||||||||||||||||||
| maximum: 8 | ||||||||||||||||||
| minimum: 1 | ||||||||||||||||||
| type: integer | ||||||||||||||||||
| default: 1 | ||||||||||||||||||
| resolution: | ||||||||||||||||||
| $ref: '#/components/schemas/Resolution' | ||||||||||||||||||
| color_palette: | ||||||||||||||||||
|
|
@@ -699,6 +707,12 @@ components: | |||||||||||||||||
| example: 50 | ||||||||||||||||||
| magic_prompt_option: | ||||||||||||||||||
| $ref: '#/components/schemas/MagicPromptOption' | ||||||||||||||||||
| num_images: | ||||||||||||||||||
| title: num_images | ||||||||||||||||||
| maximum: 8 | ||||||||||||||||||
| minimum: 1 | ||||||||||||||||||
| type: integer | ||||||||||||||||||
| default: 1 | ||||||||||||||||||
|
Comment on lines
+710
to
+715
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider using schema reference for num_images property. The num_images property is defined inline with the same constraints as the NumImages schema. To improve maintainability and ensure consistency, consider using a schema reference instead. Apply this change: num_images:
- title: num_images
- maximum: 8
- minimum: 1
- type: integer
- default: 1
+ $ref: '#/components/schemas/NumImages'📝 Committable suggestion
Suggested change
|
||||||||||||||||||
| seed: | ||||||||||||||||||
| title: Seed | ||||||||||||||||||
| maximum: 2147483647 | ||||||||||||||||||
|
|
@@ -792,8 +806,10 @@ components: | |||||||||||||||||
| - V_1_TURBO | ||||||||||||||||||
| - V_2 | ||||||||||||||||||
| - V_2_TURBO | ||||||||||||||||||
| - V_2_1 | ||||||||||||||||||
| - V_2_1_TURBO | ||||||||||||||||||
| type: string | ||||||||||||||||||
| description: 'The model used to generate an image or edit one. /generate supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.' | ||||||||||||||||||
| description: 'The model used to generate an image or edit one. /generate and /remix supports all model types, however, /edit is only supported for V_2 and V_2_TURBO.' | ||||||||||||||||||
|
Comment on lines
+809
to
+812
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Inconsistency found in model compatibility documentation The ModelEnum description states that "/edit is only supported for V_2 and V_2_TURBO", but this appears to be outdated since the ModelEnum now includes V_2_1 and V_2_1_TURBO. The endpoint documentation doesn't explicitly specify model restrictions for any endpoint, making it unclear whether the compatibility statement is accurate.
🔗 Analysis chainLGTM: Model enum updates with clear compatibility documentation. The addition of V_2_1 and V_2_1_TURBO models and the updated description clearly documenting endpoint compatibility is well implemented. Let's verify the model compatibility documentation in the API endpoints: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify model compatibility documentation in endpoints
# Check if the model compatibility is consistently documented across endpoints
rg -A 5 "model:" openapi.yaml
Length of output: 82 Script: #!/bin/bash
# First, let's find the correct path to the openapi.yaml file
fd openapi.yaml
# Then, let's check the model compatibility documentation across endpoints
rg -A 5 "model:" $(fd openapi.yaml)
Length of output: 2619 Script: #!/bin/bash
# Let's check the endpoint definitions to verify the model compatibility claims
rg -B 5 -A 10 "/generate|/remix|/edit" src/libs/Ideogram/openapi.yaml
Length of output: 3008 |
||||||||||||||||||
| default: V_2 | ||||||||||||||||||
| example: V_2_TURBO | ||||||||||||||||||
| GenerateImageSafetyError: | ||||||||||||||||||
|
|
@@ -1121,6 +1137,12 @@ components: | |||||||||||||||||
| externalDocs: | ||||||||||||||||||
| url: https://docs.ideogram.ai/using-ideogram/ideogram-features/magic-prompt | ||||||||||||||||||
| example: ON | ||||||||||||||||||
| NumImages: | ||||||||||||||||||
| title: num_images | ||||||||||||||||||
| maximum: 8 | ||||||||||||||||||
| minimum: 1 | ||||||||||||||||||
| type: integer | ||||||||||||||||||
| default: 1 | ||||||||||||||||||
|
Comment on lines
+1140
to
+1145
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Inconsistent usage of NumImages schema found The verification reveals inconsistency in the OpenAPI specification:
This should be unified to consistently use the reusable NumImages schema component to maintain better maintainability and prevent potential inconsistencies. 🔗 Analysis chainLGTM: Well-defined NumImages schema. The NumImages schema is well-defined with appropriate constraints. However, ensure it's consistently used across all request schemas that include the num_images property. Let's verify the consistent usage of the NumImages schema: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify consistent usage of NumImages schema
# Check for all occurrences of num_images in the spec
rg -A 3 "num_images:" openapi.yaml
# Check for all references to NumImages schema
rg -A 1 '\$ref: ''#/components/schemas/NumImages''' openapi.yaml
Length of output: 203 Script: #!/bin/bash
# First, let's find the correct path to the OpenAPI spec file
fd -g "*openapi*.yaml" -g "*openapi*.yml"
# Once we find it, we'll verify the usage patterns
Length of output: 144 Script: #!/bin/bash
# Let's try a different approach to find the OpenAPI spec file
fd openapi
# Also try searching in common API documentation locations
fd -t f . src/libs/Ideogram/
Length of output: 10641 Script: #!/bin/bash
# Now that we found the correct path, let's check for NumImages usage
rg -A 3 "num_images:" src/libs/Ideogram/openapi.yaml
# Check for references to NumImages schema
rg -A 1 '\$ref: ''#/components/schemas/NumImages''' src/libs/Ideogram/openapi.yaml
Length of output: 446 Script: #!/bin/bash
# Let's get more context around these num_images occurrences
rg -B 2 -A 5 "num_images:" src/libs/Ideogram/openapi.yaml
Length of output: 898 |
||||||||||||||||||
| Seed: | ||||||||||||||||||
| title: Seed | ||||||||||||||||||
| maximum: 2147483647 | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider using schema reference for num_images property.
The num_images property is defined inline with the same constraints as the NumImages schema. To improve maintainability and ensure consistency, consider using a schema reference instead.
Apply this change:
📝 Committable suggestion