AI hallucination while reading JSON

I am working on building an assistant to search for real estate properties. For most questions, it works well, but when I ask more specific questions, like requesting the property code or images, it randomly selects images from the file.

I am using an JSON source that includes links to the images and defined property codes. Does anyone have any ideas on how to solve this? I tried lowering the temperature, but it didn’t help. I think my question might be too vague. I would appreciate some guidance.

I also experience various hallucinations when encountering this issue. Let’s hope that this global problem will be resolved by the developers.

I am leaving a sample of my JSON file to see if anyone can contribuite and the prompt that I am using.

Prompt:

You are an assistant for the real estate agency , responsible for qualifying leads interested in rental properties. Each property starts at the “EmailCliente” item and ends at the “Videos” item. To find the URL of the main image for each property in the provided JSON, follow these steps: 1. Navigate through the Imovel array. 2. Within each property object, look for the Fotos field. 3. Check if the Foto field is a single object or a list of objects. 4. If Foto is a single object, return the URL from the URLArquivo field if the Principal field value is 1. 5. If Foto is a list of objects, iterate through the list and find the object with the Principal field value of 1 and return the URL from the URLArquivo field of that object. 6. Return the URL of the main image only for the property whose CodigoImovel matches the given code. If the property does not have an image or it is not accessible, inform the client that we are updating the images for that property and they are not available at the moment.

JSON sample:

{
          "EmailCliente": "",
          "CodigoImovel": 21485,
          "TipoImovel": "Apartamento",
          "SubTipoImovel": "Padrão",
          "CategoriaImovel": "Padrão",
          "Cidade": "CHAPECó",
          "Bairro": "Centro",
          "Endereco": "Minas Gerais",
          "Numero": 62,
          "Complemento": "",
          "CEP": 89801015,
          "PrecoVenda": 0,
          "PrecoLocacao": 4.12,
          "PrecoLocacaoTemporada": 0,
          "PrecoCondominio": 500,
          "AreaUtil": 0,
          "AreaTotal": 128,
          "UnidadeMetrica": "m2",
          "QtdDormitorios": 2,
          "QtdSuites": 1,
          "QtdBanheiros": 1,
          "QtdSalas": 1,
          "QtdVagas": 2,
          "QtdElevador": "Nao",
          "QtdUnidadesAndar": "",
          "QtdAndar": "",
          "QtdPessoasTemporada": "",
          "AnoConstrucao": 0,
          "PossuiDivida": 0,
          "SaldoDivida": 0,
          "ValorMensalidadeDivida": "",
          "QtdParcelasRestantesDivida": "",
          "MemorialDescritivo": "",
          "Observacao": "Desfrute do conforto e modernidade do Europa no Centro, um semi-mobiliado apartamento com 3 quartos, sendo 1 suíte. Possui uma sala de dois ambientes e cozinha equipada. Detalhes em piso porcelanato, área de serviço e churrasqueira. Sinta a brisa na sacada fechada. Ainda possui poço artesiano!",
          "DataUltimaParcelaDivida": "",
          "DiaVencimentoDivida": "",
          "AceitaPermuta": 0,
          "AceitaPermutaCarro": 0,
          "AceitaPermutaImovel": 0,
          "AceitaPermutaOutro": 0,
          "ValorPermutaCarro": "",
          "ValorPermutaImovel": 0,
          "ValorPermutaOutro": "",
          "DescricaoPermuta": "",
          "Acesso24Horas": 0,
          "Agua": 0,
          "ArCondicionado": 0,
          "ArmarioCozinha": 0,
          "ArmarioEmbutido": 0,
          "BusinessCentar": 0,
          "Cerca": 0,
          "Churrasqueira": 1,
          "CoffeeShop": 0,
          "Convencoes": 0,
          "Copa": 0,
          "EntradaCaminhoes": 0,
          "Escritorio": 0,
          "EscritorioVirtual": 0,
          "Esgoto": 0,
          "Esquina": 0,
          "EstacionamentoRotativo": 0,
          "EstacionamentoVisitantes": 0,
          "EstradaAsfaltada": 0,
          "GaragemBarcos": 0,
          "Guarita": 0,
          "Heliponto": 0,
          "InfraInternet": 0,
          "Jardim": 0,
          "Lago": 0,
          "Lavoura": 0,
          "Luz": 0,
          "Marina": 0,
          "Mezanino": 0,
          "Pasto": 0,
          "PatioEstacionamento": 0,
          "Pier": 0,
          "Piscina": 0,
          "PisoElevado": 0,
          "PistaPouso": 0,
          "Playground": 0,
          "PonteRolante": 0,
          "QuadraSquash": 0,
          "QuadraTenis": 0,
          "QuadraPoliEsportiva": 0,
          "Quintal": 0,
          "RedeTelefone": 0,
          "ReservatorioAgua": 0,
          "Restaurante": 0,
          "Rio": 0,
          "RuaAsfaltada": 0,
          "SalaGinastica": 0,
          "SalaoFestas": 0,
          "SalaoJogos": 0,
          "Sauna": 0,
          "Sede": 0,
          "SegurancaRua": 0,
          "SegurancaPatrimonial": 0,
          "Silos": 0,
          "SistemaIncendio": 0,
          "Telefone": 0,
          "TVCabo": 0,
          "Varanda": 0,
          "Vestiario": 0,
          "VidrosReflexivos": 0,
          "WCEmpregada": 0,
          "EstudaPermuta": 0,
          "DepositoSubsolo": 0,
          "Closet": 0,
          "Hidromassagem": 0,
          "Lareira": 0,
          "FrenteMar": 0,
          "AndarInteiro": 0,
          "AreaServico": 0,
          "Bosque": 0,
          "CampoFutebol": 0,
          "CasaCaseiro": 0,
          "CasaFundo": 0,
          "CasaPrincipal": 0,
          "Caseiro": 0,
          "ComServico": 0,
          "CozinhaAzulejada": 0,
          "Despensa": 0,
          "EnergiaEletrica": 0,
          "EntradaServicoIndependente": 0,
          "EntradaFacilitada": 0,
          "EntradaLateral": 0,
          "Fogao": 0,
          "Freezer": 0,
          "Geladeira": 0,
          "Geminada": 0,
          "HomeTheater": 0,
          "ImovelExposicao": 0,
          "Interfone": 0,
          "LavaRoupas": 0,
          "LavanderiaColetiva": 0,
          "Isolada": 0,
          "LivingTabuasLargas": 0,
          "MeioAndar": 0,
          "Microondas": 0,
          "Oferta": 0,
          "Paiol": 0,
          "ParaIncorporacao": 0,
          "PistaBicicross": 0,
          "PistaCooper": 0,
          "PistaSkate": 0,
          "Poco": 0,
          "PocoArtesiano": 1,
          "PorteiraFechada": 0,
          "ProntoMorar": 0,
          "Refeitorio": 0,
          "RoupaBanho": 0,
          "RoupaCama": 0,
          "RoupaMesa": 0,
          "SalaAlmoco": 0,
          "SalaJantar": 0,
          "SalaIntima": 0,
          "SalaVideo": 0,
          "SegurancaInterna": 0,
          "Semigeminad": 0,
          "SpaHidromassagem": 0,
          "StandVendasLocal": 0,
          "TV": 0,
          "UtensiliosCozinha": 0,
          "UtilizeFGTS": 0,
          "VentiladoresTeto": 0,
          "VisiteImovelDecorado": 0,
          "Clube": 0,
          "ChildrenCare": 0,
          "Curral": 0,
          "Mobiliado": 0,
          "Recuo": 0,
          "Solarium": 0,
          "CasaMista": 0,
          "CasaAlvenaria": 0,
          "CasaMadeira": 0,
          "Terraco": 0,
          "EmDestaque": 0,
          "Latitude": 0,
          "Longitude": 0,
          "Pais": "",
          "UF": "SC",
          "Zona": "",
          "IPTU": 150,
          "TituloImovel": "",
          "LinkTourVirtual": "",
          "Fotos": {
            "Foto": [
              {
                "NomeArquivo": "10276_i99JpRt2kpFCf_10276664760b5ed9c7.jpg",
                "URLArquivo": "https://cdn.vistahost.com.br/cli8829/vista.imobi/fotos/10276/i99JpRt2kpFCf_10276664760b5ed9c7.jpg",
                "Principal": 1
              }
            ]
          },
          "Videos": ""
        },
        {
          "EmailCliente": "",
          "CodigoImovel": 8534,
          "TipoImovel": "Apartamento",
          "SubTipoImovel": "Padrão",
          "CategoriaImovel": "Padrão",
          "Cidade": "CHAPECó",
          "Bairro": "Centro",
          "Endereco": "Getúlio Dorneles Vargas - N",
          "Numero": 267,
          "Complemento": "",
          "CEP": 89801000,
          "PrecoVenda": "1.289.000",
          "PrecoLocacao": 0,
          "PrecoLocacaoTemporada": 0,
          "PrecoCondominio": 500,
          "AreaUtil": 141,
          "AreaTotal": 173,
          "UnidadeMetrica": "m2",
          "QtdDormitorios": 2,
          "QtdSuites": 1,
          "QtdBanheiros": 1,
          "QtdSalas": 0,
          "QtdVagas": 4,
          "QtdElevador": "Sim",
          "QtdUnidadesAndar": "",
          "QtdAndar": "",
          "QtdPessoasTemporada": "",
          "AnoConstrucao": 0,
          "PossuiDivida": 0,
          "SaldoDivida": 0,
          "ValorMensalidadeDivida": "",
          "QtdParcelasRestantesDivida": "",
          "MemorialDescritivo": "",
          "Observacao": "",
          "DataUltimaParcelaDivida": "",
          "DiaVencimentoDivida": "",
          "AceitaPermuta": 0,
          "AceitaPermutaCarro": 0,
          "AceitaPermutaImovel": 0,
          "AceitaPermutaOutro": 0,
          "ValorPermutaCarro": "",
          "ValorPermutaImovel": 0,
          "ValorPermutaOutro": "",
          "DescricaoPermuta": "",
          "Acesso24Horas": 0,
          "Agua": 0,
          "ArCondicionado": 0,
          "ArmarioCozinha": 0,
          "ArmarioEmbutido": 0,
          "BusinessCentar": 0,
          "Cerca": 0,
          "Churrasqueira": 0,
          "CoffeeShop": 0,
          "Convencoes": 0,
          "Copa": 0,
          "EntradaCaminhoes": 0,
          "Escritorio": 0,
          "EscritorioVirtual": 0,
          "Esgoto": 0,
          "Esquina": 0,
          "EstacionamentoRotativo": 0,
          "EstacionamentoVisitantes": 0,
          "EstradaAsfaltada": 0,
          "GaragemBarcos": 0,
          "Guarita": 0,
          "Heliponto": 0,
          "InfraInternet": 0,
          "Jardim": 0,
          "Lago": 0,
          "Lavoura": 0,
          "Luz": 0,
          "Marina": 0,
          "Mezanino": 0,
          "Pasto": 0,
          "PatioEstacionamento": 0,
          "Pier": 0,
          "Piscina": 0,
          "PisoElevado": 0,
          "PistaPouso": 0,
          "Playground": 0,
          "PonteRolante": 0,
          "QuadraSquash": 0,
          "QuadraTenis": 0,
          "QuadraPoliEsportiva": 0,
          "Quintal": 0,
          "RedeTelefone": 0,
          "ReservatorioAgua": 0,
          "Restaurante": 0,
          "Rio": 0,
          "RuaAsfaltada": 0,
          "SalaGinastica": 0,
          "SalaoFestas": 1,
          "SalaoJogos": 1,
          "Sauna": 0,
          "Sede": 0,
          "SegurancaRua": 0,
          "SegurancaPatrimonial": 0,
          "Silos": 0,
          "SistemaIncendio": 0,
          "Telefone": 0,
          "TVCabo": 0,
          "Varanda": 0,
          "Vestiario": 0,
          "VidrosReflexivos": 0,
          "WCEmpregada": 0,
          "EstudaPermuta": 0,
          "DepositoSubsolo": 0,
          "Closet": 0,
          "Hidromassagem": 0,
          "Lareira": 0,
          "FrenteMar": 0,
          "AndarInteiro": 0,
          "AreaServico": 0,
          "Bosque": 0,
          "CampoFutebol": 0,
          "CasaCaseiro": 0,
          "CasaFundo": 0,
          "CasaPrincipal": 0,
          "Caseiro": 0,
          "ComServico": 0,
          "CozinhaAzulejada": 0,
          "Despensa": 0,
          "EnergiaEletrica": 0,
          "EntradaServicoIndependente": 0,
          "EntradaFacilitada": 0,
          "EntradaLateral": 0,
          "Fogao": 0,
          "Freezer": 0,
          "Geladeira": 0,
          "Geminada": 0,
          "HomeTheater": 0,
          "ImovelExposicao": 0,
          "Interfone": 1,
          "LavaRoupas": 0,
          "LavanderiaColetiva": 0,
          "Isolada": 0,
          "LivingTabuasLargas": 0,
          "MeioAndar": 0,
          "Microondas": 0,
          "Oferta": 0,
          "Paiol": 0,
          "ParaIncorporacao": 0,
          "PistaBicicross": 0,
          "PistaCooper": 0,
          "PistaSkate": 0,
          "Poco": 0,
          "PocoArtesiano": 0,
          "PorteiraFechada": 0,
          "ProntoMorar": 0,
          "Refeitorio": 0,
          "RoupaBanho": 0,
          "RoupaCama": 0,
          "RoupaMesa": 0,
          "SalaAlmoco": 0,
          "SalaJantar": 1,
          "SalaIntima": 0,
          "SalaVideo": 0,
          "SegurancaInterna": 0,
          "Semigeminad": 0,
          "SpaHidromassagem": 0,
          "StandVendasLocal": 0,
          "TV": 0,
          "UtensiliosCozinha": 0,
          "UtilizeFGTS": 0,
          "VentiladoresTeto": 0,
          "VisiteImovelDecorado": 0,
          "Clube": 0,
          "ChildrenCare": 0,
          "Curral": 0,
          "Mobiliado": 0,
          "Recuo": 0,
          "Solarium": 0,
          "CasaMista": 0,
          "CasaAlvenaria": 0,
          "CasaMadeira": 0,
          "Terraco": 1,
          "EmDestaque": 0,
          "Latitude": 0,
          "Longitude": 0,
          "Pais": "",
          "UF": "SC",
          "Zona": "",
          "IPTU": 0,
          "TituloImovel": "",
          "LinkTourVirtual": "",
          "Fotos": {
            "Foto": [
              {
                "NomeArquivo": "10275_i7C9dE4O7V1k5_1027566478da9cf48e.jpg",
                "URLArquivo": "https://cdn.vistahost.com.br/cli8829/vista.imobi/fotos/10275/i7C9dE4O7V1k5_1027566478da9cf48e.jpg",
                "Principal": 1
              }

I am seeing some AIs in the market actually working well with the same type of product I am building, so I am definitely doing something wrong.

I would try to adjust the temperature to zero, this should avoid hallucinations

1 Like