This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pillar | Purpose | Example | |
---|---|---|---|
Model | The AI model (LLM, multi-modal model) that generates outputs | GPT-4, Claude, LLaMA-3 | |
Context | All information the model can see: memory, external tool outputs, user inputs, world knowledge | Search results, past conversation history, documents, environment state | |
Protocol | The standardized way to package, retrieve, and update context information | JSON schemas, tool call formats, memory retrieval specifications |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nested Fields | |
--------------------- | |
Following is what is meant by nested_fields. This will break. Index will not be created as nested_fields are greater than 2. | |
"mappings": { | |
"properties": { | |
"user": { | |
"type": "nested" | |
}, | |
"address":{ | |
"type": "nested" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String query = "SELECT DISTINCT article_id from articles WHERE article_summary IS NULL"; | |
SqlConnection connection = new SqlConnection(); | |
SqlCommand command = new SqlCommand(query, connection.getDatabaseConnection()); | |
ResultSet resultSet = command.executeSelect(); | |
int counter = 1; | |
List idList = new ArrayList(); | |
//populate List::idList | |
while (resultSet.next()) { | |
idList.add(resultSet.getInt("article_id")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Iterator iter = myMap.entrySet().iterator(); | |
while (iter.hasNext()) { | |
Map.Entry mapEntry = (Map.Entry) iter.next(); | |
System.out.println(mapEntry.getKey() + " : " + mapEntry.getValue()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Takes the zipfile location and output directory and returns the reference to output folder | |
* @param zfile | |
* @param outDir | |
* @throws IOException | |
* | |
*/ | |
public File unzep(String zfile, String outDir) throws IOException | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* read from input stream and store in file. | |
*/ | |
InputStream in = ..... | |
File file = File.createTempFile(filename,".dat"); | |
FileOutputStream fos = new FileOutputStream(file,true); | |
byte[] b = new byte[4096]; | |
while(in.read(b, 0, 4096) != -1) | |
{ | |
fos.write(b,0,4096); |