With these preparations in place, you can perform the testing using the above sample code. For this, though, you first have to install the oci pip module into the notebook. With Google, that works as follows:
!pip install -U oci
Then, the unmodified code from the sample should work and should give an output such as:
*************************Chat Result**************************
{'status': 200, 'headers': {'content-type': 'application/json', 'opc-request-id': 'XXXXX', 'content-encoding': 'gzip', 'content-length': '1400'}, 'data': {
"chat_response": {
"api_format": "GENERIC",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": {
"text_offset": null,
"token_logprobs": null,
"tokens": null,
"top_logprobs": null
},
"message": {
"content": [
{
"text": "**Introducing the OmniMic: Revolutionizing Audio Recording with Surround Sound**\n\nAre you a musician, podcaster, or content creator looking for a high-quality, easy-to-use microphone that can capture immersive audio? Look no further than the OmniMic, a compact USB-connected microphone that records stunning surround sound.\n\n**Immersive Audio at Your Fingertips**\n\nThe OmniMic is designed to capture 360-degree audio, allowing you to record music, conversations, and podcasts with unparalleled depth and clarity. Its advanced technology ensures that every nuance of sound is picked up, from the subtlest whisper to the loudest instrument.\n\n**Perfect for Musicians**\n\nWith the OmniMic, musicians can record live performances or rehearsals with ease. Capture the energy of your band's performance or create professional-sounding demos without breaking the bank. The microphone's compact size makes it perfect for recording in small spaces or on-the-go.\n\n**Ideal for Podcasters**\n\nTake your podcast to the next level with the OmniMic's crystal-clear audio. Record interviews, panel discussions, or solo episodes with confidence, knowing that every word will be captured in stunning detail. The microphone's plug-and-play design makes it easy to set up and start recording in minutes.\n\n**Key Features:**\n\n* Compact design (only 3 inches in diameter)\n* USB connectivity for easy plug-and-play use\n* Records surround sound (360-degree audio)\n* High-quality condenser capsules for clear and detailed sound\n* Compatible with Mac and PC\n* Includes carrying case and windscreen\n\n**Benefits:**\n\n* Easy to use: simply plug in and start recording\n* High-quality audio: captures every nuance of sound\n* Versatile: perfect for music recording, podcasting, voiceovers, and more\n* Portable: take it anywhere and record on-the-go\n\n**Who Can Benefit from the OmniMic?**\n\n* Musicians (solo artists or bands)\n* Podcasters (interview-style or solo episodes)\n* Voiceover artists\n* Content creators (YouTube videos, online courses)\n* Anyone looking for high-quality audio recording capabilities\n\n**Get Ready to Elevate Your Audio Game**\n\nExperience the power of surround sound recording with the OmniMic. Order now and discover a new world of immersive audio possibilities.\n\n**Pricing:** $199 (includes carrying case and windscreen)\n\n**Order Now:** Visit our website or visit your local music store today!",
"type": "TEXT"
}
],
"name": null,
"role": "ASSISTANT"
}
}
],
"time_created": "2024-11-03T12:27:17.611000+00:00"
},
"model_id": "ocid1.generativeaimodel.oc1.us-chicago-1.amaaaaaask7dceyarleil5jr7k2rykljkhapnvhrqvzx4cwuvtfedlfxet4q",
"model_version": "1.0.0"
}}
This concludes the verification of the OCI setup, now we can easily set up a Langchain chain.