Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f736d07
Metadata Enrichment (#200)
ArthSrivastava Aug 27, 2023
a2e6e13
Google Java Format
Aug 27, 2023
bdd019f
Prompt A/B Testing | Non-Null Checks For toJson() | Refining PgVector…
EmadHanif01 Aug 27, 2023
1ee8802
Google Java Format
Aug 27, 2023
9c42caf
Update README.md
Aug 30, 2023
e0fc900
Google Java Format
Aug 30, 2023
60e1ad9
Update README.md
Aug 30, 2023
d7a6979
Update README.md
Aug 30, 2023
6fe86df
Update README.md
Aug 30, 2023
24175b2
React Chain Fix (#204)
ArthSrivastava Aug 30, 2023
42f4a45
Google Java Format
Aug 30, 2023
bfb11cb
Update README.md
Aug 31, 2023
3eb4df1
Update README.md
Aug 31, 2023
f3477cf
Update README.md
Sep 1, 2023
c454dfa
Update README.md
Sep 2, 2023
375f78b
Parallelization & Metadata Enrichment Fixes (#207)
ArthSrivastava Sep 2, 2023
2b5c778
Google Java Format
Sep 2, 2023
9c2cab9
ArkRequest ~ Fixing JsonParsing (#209)
EmadHanif01 Sep 2, 2023
fed9d3f
Google Java Format
Sep 2, 2023
0375e6c
Add parent pom and related works (#201)
robincakeellis Sep 2, 2023
89d1906
Google Java Format
Sep 2, 2023
c7719f3
Update BuildAndRun.yml
Sep 2, 2023
a654eeb
Update pr-build.yml
Sep 3, 2023
0f0e324
Robin code quality (#206)
robincakeellis Sep 3, 2023
d6b8803
Google Java Format
Sep 3, 2023
2110ef2
Fix stall issue with Retrofit OKHttp interceptor (#210)
robincakeellis Sep 3, 2023
4fc7e72
Google Java Format
Sep 3, 2023
889cd63
Query with metadata fix (#211)
ArthSrivastava Sep 3, 2023
1ce01cd
Google Java Format
Sep 3, 2023
7b6daec
Refactored and Fixed Parallel Upsert in PostgreSQL Embeddings (#213)
EmadHanif01 Sep 3, 2023
7f48d4a
Google Java Format
Sep 3, 2023
f52a23c
[ATTENTION] tests for Postgres client with potential issues (#215)
robincakeellis Sep 4, 2023
0353962
Google Java Format
Sep 4, 2023
9226009
Spring Boot update (#216)
robincakeellis Sep 4, 2023
05448b7
Google Java Format
Sep 4, 2023
d222eeb
Added test cases in edgechain-app (#221)
hemantDwivedi Sep 9, 2023
6425143
Query with 'n' embeddings | Query with Rank Reciprocal Function | Exa…
EmadHanif01 Sep 11, 2023
9fa2052
Google Java Format
Sep 11, 2023
f786cad
[Fix] QueryRRF Response (#223)
EmadHanif01 Sep 12, 2023
eb61274
Google Java Format
Sep 12, 2023
6754f2b
Tuning QueryRRF (#224)
EmadHanif01 Sep 13, 2023
2969024
Google Java Format
Sep 13, 2023
29c94b2
FIXED WikiClientTest (#228)
hemantDwivedi Sep 15, 2023
7c1727b
Google Java Format
Sep 15, 2023
36d0c37
Batch Insertion into Join Table (#229)
ArthSrivastava Sep 16, 2023
bebe4b4
Google Java Format
Sep 16, 2023
39ab0c7
added test cases for pineconeclient (#230)
hemantDwivedi Sep 18, 2023
c7f0caa
Google Java Format
Sep 18, 2023
1f5dac5
Update README.md
Sep 20, 2023
21bf6d4
Update README.md
Sep 20, 2023
d50d5ed
Query RRF With 'n' Embeddings (#231)
EmadHanif01 Sep 26, 2023
e4a4b02
Google Java Format
Sep 26, 2023
86b91e7
Update README.md
Sep 30, 2023
e8162ff
Embedding <> Database | Airtable Integration | Context Reorder | Rest…
EmadHanif01 Sep 30, 2023
4cdea9c
Google Java Format
Sep 30, 2023
24ed94a
Fix Issue (#243)
EmadHanif01 Oct 1, 2023
effd742
Google Java Format
Oct 1, 2023
f6f813d
Update README.md
Oct 4, 2023
e24c63b
Llama Implementationn. (#248)
hemantDwivedi Oct 6, 2023
1b63602
Google Java Format
Oct 6, 2023
24cf405
Get request (#255)
hemantDwivedi Oct 15, 2023
6b893a1
Google Java Format
Oct 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
29 changes: 2 additions & 27 deletions .github/workflows/BuildAndRun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,13 @@ jobs:
- name: Create output folder
run: mkdir BuildOutput

# - name: Build flyfly project
# working-directory: ./FlySpring/flyfly
# run: mvn clean package

# - name: Copy flyfly JAR to Examples folder and rename
# run: cp ./FlySpring/flyfly/target/flyfly-0.0.1-SNAPSHOT.jar ././BuildOutput/flyfly.jar

- name: Build edgechain-app project
working-directory: ./FlySpring/edgechain-app
working-directory: ./FlySpring
# run: mvn -Djavacpp.platform=linux-x86_64 clean package -DskipTests
run: mvn clean package -DskipTests

- name: Run edgechain testcases
working-directory: ./FlySpring/edgechain-app
working-directory: ./FlySpring
run: mvn test

- name: Copy edgechain-app JAR to Examples folder
Expand All @@ -72,24 +65,6 @@ jobs:
- name: Display structure of downloaded files
run: ls -R

# - name: Create Release
# id: create_release
# uses: actions/create-release@v1.1.4
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: ${{ github.ref }}
# - name: Upload Release jar
# id: upload_release_asset
# uses: actions/upload-release-asset@v1.0.1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Examples/
# asset_name: Examples
# asset_content_type: application/zip
- name: 'Get variables'
id: vars
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ jobs:
run: mkdir BuildOutput

- name: Build edgechain-app project
working-directory: ./FlySpring/edgechain-app
working-directory: ./FlySpring
# run: mvn -Djavacpp.platform=linux-x86_64 clean package -DskipTests
run: mvn clean package -DskipTests

- name: Run edgechain testcases
working-directory: ./FlySpring/edgechain-app
working-directory: ./FlySpring
run: mvn test

- name: Copy edgechain-app JAR to Examples folder
Expand All @@ -74,5 +75,4 @@ jobs:
with:
name: Output
path: ./BuildOutput/


3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ build/

### VS Code ###
.vscode/
**/out/
.DS_Store

Binary file removed Examples/.DS_Store
Binary file not shown.
134 changes: 134 additions & 0 deletions Examples/airtable/AirtableExample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
package com.edgechain;

import com.edgechain.lib.endpoint.impl.integration.AirtableEndpoint;
import com.edgechain.lib.integration.airtable.query.AirtableQueryBuilder;
import com.edgechain.lib.integration.airtable.query.SortOrder;
import com.edgechain.lib.request.ArkRequest;
import com.edgechain.lib.response.ArkResponse;
import com.edgechain.lib.rxjava.transformer.observable.EdgeChain;
import dev.fuxing.airtable.AirtableRecord;
import dev.fuxing.airtable.formula.AirtableFormula;
import dev.fuxing.airtable.formula.LogicalOperator;
import org.json.JSONObject;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.web.bind.annotation.*;

import java.util.Properties;

/**
* For the purpose, of this example, create a simple table using AirTable i.e, "Speakers" Following
* are some basic fields: "speaker_name", "designation", "organization", "biography",
* "speaker_photo", "rating To get, your BASE_ID of specific database; use the following API
* https://api.airtable.com/v0/meta/bases --header 'Authorization: Bearer
* YOUR_PERSONAL_ACCESS_TOKEN' You can create, complex tables using Airtable; also define
* relationships b/w tables via lookups.
*/
@SpringBootApplication
public class AirtableExample {
private static final String AIRTABLE_API_KEY = "";
private static final String AIRTABLE_BASE_ID = "";

private static AirtableEndpoint airtableEndpoint;

public static void main(String[] args) {

System.setProperty("server.port", "8080");

Properties properties = new Properties();
properties.setProperty("cors.origins", "http://localhost:4200");

new SpringApplicationBuilder(AirtableExample.class).properties(properties).run(args);

airtableEndpoint = new AirtableEndpoint(AIRTABLE_BASE_ID, AIRTABLE_API_KEY);
}

@RestController
@RequestMapping("/airtable")
public class AirtableController {

@GetMapping("/findAll")
public ArkResponse findAll(ArkRequest arkRequest) {

int pageSize = arkRequest.getIntQueryParam("pageSize");
String sortSpeakerName = arkRequest.getQueryParam("sortName");
String offset = arkRequest.getQueryParam("offset");

AirtableQueryBuilder queryBuilder = new AirtableQueryBuilder();
queryBuilder.pageSize(pageSize); // pageSize --> no. of records in each request
queryBuilder.sort("speaker_name", SortOrder.fromValue(sortSpeakerName).getValue());
queryBuilder.offset(offset); // move to next page by passing offset returned in response;

// Return only those speakers which have rating Greater Than Eq to 3;
queryBuilder.filterByFormula(
LogicalOperator.GTE,
AirtableFormula.Object.field("rating"),
AirtableFormula.Object.value(3));

return new EdgeChain<>(airtableEndpoint.findAll("Speakers", queryBuilder)).getArkResponse();
}

@GetMapping("/find")
public ArkResponse findById(ArkRequest arkRequest) {
String id = arkRequest.getQueryParam("id");
return new EdgeChain<>(airtableEndpoint.findById("Speakers", id)).getArkResponse();
}

@PostMapping("/create")
public ArkResponse create(ArkRequest arkRequest) {

JSONObject body = arkRequest.getBody();
String speakerName = body.getString("name");
String designation = body.getString("designation");
int rating = body.getInt("rating");
String organization = body.getString("organization");
String biography = body.getString("biography");

// Airtable API doesn't allow to upload blob files directly; therefore, you would require to
// upload it
// to some cloud storage i.e, S3 and then set the URL in Airtable.

AirtableRecord record = new AirtableRecord();
record.putField("speaker_name", speakerName);
record.putField("designation", designation);
record.putField("rating", rating);
record.putField("organization", organization);
record.putField("biography", biography);

return new EdgeChain<>(airtableEndpoint.create("Speakers", record)).getArkResponse();
}

@PostMapping("/update")
public ArkResponse update(ArkRequest arkRequest) {

JSONObject body = arkRequest.getBody();
String id = body.getString("id");
String speakerName = body.getString("name");
String designation = body.getString("designation");
int rating = body.getInt("rating");
String organization = body.getString("organization");
String biography = body.getString("biography");

// Airtable API doesn't allow to upload blob files directly; therefore, you would require to
// upload it
// to some cloud storage i.e, S3 and then set the URL in Airtable.

AirtableRecord record = new AirtableRecord();
record.setId(id);
record.putField("speaker_name", speakerName);
record.putField("designation", designation);
record.putField("rating", rating);
record.putField("organization", organization);
record.putField("biography", biography);

return new EdgeChain<>(airtableEndpoint.update("Speakers", record)).getArkResponse();
}

@DeleteMapping("/delete")
public ArkResponse delete(ArkRequest arkRequest) {
JSONObject body = arkRequest.getBody();
String id = body.getString("id");
return new EdgeChain<>(airtableEndpoint.delete("Speakers", id)).getArkResponse();
}
}
}
6 changes: 3 additions & 3 deletions Examples/code-interpreter/CodeInterpreter.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.util.concurrent.TimeUnit;

import com.edgechain.lib.endpoint.impl.llm.OpenAiChatEndpoint;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand All @@ -13,7 +14,6 @@
import org.springframework.web.bind.annotation.RestController;

import com.edgechain.lib.codeInterpreter.Eval;
import com.edgechain.lib.endpoint.impl.OpenAiEndpoint;
import com.edgechain.lib.jsonnet.JsonnetArgs;
import com.edgechain.lib.jsonnet.JsonnetLoader;
import com.edgechain.lib.jsonnet.enums.DataType;
Expand All @@ -28,7 +28,7 @@
public class CodeInterpreter {

private static final String OPENAI_AUTH_KEY = "";
private static OpenAiEndpoint userChatEndpoint;
private static OpenAiChatEndpoint userChatEndpoint;
private static final ObjectMapper objectMapper = new ObjectMapper();
private static JsonnetLoader loader =
new FileJsonnetLoader("./code-interpreter/code-interpreter.jsonnet");
Expand All @@ -48,7 +48,7 @@ public double interpret(ArkRequest arkRequest) throws JSONException {
JSONObject json = arkRequest.getBody();

userChatEndpoint =
new OpenAiEndpoint(
new OpenAiChatEndpoint(
OPENAI_CHAT_COMPLETION_API,
OPENAI_AUTH_KEY,
"gpt-3.5-turbo",
Expand Down
10 changes: 5 additions & 5 deletions Examples/json/JsonFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.List;
import java.util.concurrent.TimeUnit;

import com.edgechain.lib.endpoint.impl.llm.OpenAiChatEndpoint;
import org.json.JSONObject;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
Expand All @@ -17,7 +18,6 @@
import org.springframework.web.client.RestTemplate;

import com.edgechain.lib.constants.EndpointConstants;
import com.edgechain.lib.endpoint.impl.OpenAiEndpoint;
import com.edgechain.lib.jsonFormat.request.FunctionRequest;
import com.edgechain.lib.jsonFormat.request.Message;
import com.edgechain.lib.jsonFormat.request.OpenApiFunctionRequest;
Expand All @@ -41,7 +41,7 @@ public class JsonFormat {
// need only for situation endpoint
private static final String OPENAI_ORG_ID = "";

private static OpenAiEndpoint userChatEndpoint;
private static OpenAiChatEndpoint userChatEndpoint;
private static JsonnetLoader loader = new FileJsonnetLoader("./json/json-format.jsonnet");
private static JsonnetLoader functionLoader = new FileJsonnetLoader("./json/function.jsonnet");
private static final ObjectMapper objectMapper = new ObjectMapper();
Expand Down Expand Up @@ -84,7 +84,7 @@ public class ExampleController {
public String extract(ArkRequest arkRequest) {

userChatEndpoint =
new OpenAiEndpoint(
new OpenAiChatEndpoint(
OPENAI_CHAT_COMPLETION_API,
OPENAI_AUTH_KEY,
"gpt-3.5-turbo",
Expand Down Expand Up @@ -129,8 +129,8 @@ public String situation(ArkRequest arkRequest) {

JSONObject json = arkRequest.getBody();

OpenAiEndpoint userChat =
new OpenAiEndpoint(
OpenAiChatEndpoint userChat =
new OpenAiChatEndpoint(
EndpointConstants.OPENAI_CHAT_COMPLETION_API,
OPENAI_AUTH_KEY,
OPENAI_ORG_ID,
Expand Down
Loading
Loading