![]() Improved Sync performance with parallel project imports.Layout Inspector recomposition rendering highlights.To recap, Android Studio Electric Eel (2022.1.1) includes these new enhancements & features: It also includes a number of other notable improvements that are covered here. IntelliJ Platform Update - Android Studio Electric Eel (2022.1.1) includes the IntelliJ 2022.1 platform release, which has many new features such as Dependency Analyzer to facilitate dependency management and conflict resolution and the Notifications tool window that offers a new, streamlined way to receive notifications from the IDE. Val params = Parameters.Physical Devices Mirroring (Android Studio and Physical Deice) Because we have a simple data structure in the droidcon demo, it was quick and easy to build a ‘proof of concept’ by hardcoding the schema.įigure 3 shows the hardcoded schema description along with prompt prefix and suffix that guides the model in how to interpret it. The ideal way to achieve this is by inferring the actual database schema and feeding it to the model as a function parameter. Now we need to figure out what the parameters are, and then how to handle the function when called.Įxposing the table schema to the chat model via a function can enable it to generate its own queries. Output should be a fully formed SQL query."įigure 2: Starting point for the AskDatabaseFunction Return "Answer user questions about conference sessions like what room sessions are presented in. You can view the result in the functions/AskDatabaseFunction.kt file, and the descriptive properties are shown in Figure 2: We’ll start by creating the call function class, using the template from the save favorites blog post. In a production application, you would spend more time on a robust data strategy. ![]() Since this is a sample focused on AI and not SQL, you’ll notice the schema and code is somewhat simplistic. See the data/DroidconDatabase.kt file for the complete database schema and data loading functionality. In our use case, we’ll only be executing against a read-only database API, so there’s no risk of data loss, and there’s only a single-user’s favorites stored so no privacy concerns either. It could also expose data you don’t want the user to see (from system tables, internal tables, or data they shouldn’t have access to). Unlike those functions, however, we’ll be using the rawQuery() function rather than building up “strongly typed” queries because the SQL will be generated by the model.Īs the example explains, this can be dangerous in production applications, as the model is not perfectly reliable at generating valid SQL, so there’s a possibility that it’ll generate code that won’t run (or an even more remote possibility that it could generate destructive queries). Just like the previous posts on storing favorites and vectors, we’ll use the Android Sqlite APIs described in the the SQLite training documentation. In this post, we’ll implement the model generated arguments function call in Kotlin, using the droidcon SF 2023 conference schedule data as the source.įigure 1: JetchatAI droidcon SF demo answering questions with dynamically generated and executed SQL SQLite on Android There’s also a natural language to SQL demo that demonstrates the model’s understanding of SQL. The OpenAI Cookbook examples repo includes a section on how to call functions with model generated arguments, which includes a python demo of a function that understands a database schema and generates SQL that is executed to answer questions from the chat. Previous blogs explained how to add droidcon session favorites to a database and also cache the embedding vectors in a database – but what if we stored everything in a database and then let the model query it directly?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |