(self,params)
| 37 | return ret |
| 38 | |
| 39 | def convert_prompt(self,params): |
| 40 | lines = "Your input should be a json (args json schema): {{" |
| 41 | for p in params: |
| 42 | logger.debug(p) |
| 43 | optional = not p['required'] |
| 44 | description = p.get('description', '') |
| 45 | if len(description) > 0: |
| 46 | description = "("+description+")" |
| 47 | |
| 48 | lines += '"{name}" : {type}{desc}, '.format(name=p['name'], |
| 49 | type= p['schema']['type'], |
| 50 | optional=optional, |
| 51 | desc=description) |
| 52 | |
| 53 | lines += "}}" |
| 54 | return lines |
| 55 | |
| 56 | |
| 57 |