A POC Azure Function App that uses Azure OpenAI Services to help users place objects within a room.
- Clone the repo
- Create a new Azure Function App
- Create a new Azure OpenAI Service resource
- Setup a model in the Azure OpenAI Service resource based on davinci-codex
- Setup environment variables in the Azure Function App
- Deploy the Azure Function App
| Name | Description |
|---|---|
| OPENAI_API_KEY | The API key for the Azure OpenAI Service resource |
| OPENAI_ENDPOINT | The endpoint for the Azure OpenAI Service resource |
The request body should be a JSON object with the following properties:
| Name | Type | Description |
|---|---|---|
room_dimensions |
Object | An object containing the dimensions of the room. |
room_dimensions.dim_x |
Number | The length of the room in the x direction. |
room_dimensions.dim_y |
Number | The length of the room in the y direction. |
room_dimensions.dim_z |
Number | The height of the room. |
objects |
Array | An array of objects to place in the room. |
objects[].name |
String | The name of the object. |
objects[].dimensions |
Object | An object containing the dimensions of the object. |
objects[].dimensions.dim_x |
Number | The length of the object in the x direction. |
objects[].dimensions.dim_y |
Number | The length of the object in the y direction. |
objects[].dimensions.dim_z |
Number | The height of the object. |
Example request body:
{
"room_dimensions": {
"dim_x": 10,
"dim_y": 10,
"dim_z": 3
},
"objects": [
{
"name": "Table",
"dimensions": {
"dim_x": 2,
"dim_y": 2,
"dim_z": 1
}
},
{
"name": "Chair",
"dimensions": {
"dim_x": 1,
"dim_y": 1,
"dim_z": 2
}
}
]
}You can use the Furnish UI project to visualize the layout generated by this function. Source code for the Furnish UI can be found here