Skip to content

Commit

Permalink
Update - revert detection back to inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
aybruhm committed Nov 30, 2023
1 parent b98d013 commit a100fef
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions agenta-web/src/lib/helpers/openapi_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ const getBodySchemaName = (schema: GenericObject): string => {

export const detectChatVariantFromOpenAISchema = (schema: GenericObject) => {
const bodySchemaName = getBodySchemaName(schema)
const bodyProperties = schema.components.schemas[bodySchemaName].properties
const propertiesWithMessages = Object.keys(bodyProperties).filter((property) => {
return bodyProperties[property]["x-parameter"] === "messages"
})
return propertiesWithMessages[0] === "messages"
return (
schema.components.schemas[bodySchemaName].properties?.inputs?.["x-parameter"] === "messages"
)
}

export const openAISchemaToParameters = (schema: GenericObject): Parameter[] => {
Expand Down

0 comments on commit a100fef

Please sign in to comment.