erDiagram
CodeSnippet {
text id PK
datetime created_at
datetime updated_at
text code
integer start_line
integer end_line
text prediction FK
}
Prediction ||--o{ CodeSnippet: "generated"
FollowUpType {
text id PK
datetime created_at
datetime updated_at
text name FK "UNIQUE"
}
FollowUp {
text id PK
datetime created_at
datetime updated_at
text parent_prediction FK
text follow_up_type FK
}
FollowUp }o--|| FollowUpType: "is of type"
FollowUp }o--|| Prediction: "is follow up of"
FrameworkItem {
text id PK
datetime created_at
datetime updated_at
text name "UNIQUE"
text url "NULL"
text description
text source "NULL"
text framework FK
}
FrameworkItem }o--|| Framework: "belongs to"
Framework {
text id PK
datetime created_at
datetime updated_at
text name "UNIQUE"
text url "NULL"
}
Llm {
text id PK
datetime created_at
datetime updated_at
text name "UNIQUE"
}
Prediction {
text id PK
datetime created_at
datetime updated_at
text text
integer token_amount
float repeat_penalty
integer max_tokens
integer seed
float temperature
top_p float
text parent_follow_up FK "NULL"
text framework_item FK
text llm FK
text system_prompt FK "NULL"
}
FollowUp ||--o{ Prediction: "is follow up of"
Prediction }o--|| FrameworkItem: "belongs to"
Prediction }o--|| Llm: "generated by"
SystemPrompt ||--o{ Prediction: "used for"
PromptPartUsage {
text id PK
datetime created_at
datetime updated_at
integer position
text prompt_part FK
text prediction FK
}
PromptPartUsage }o--|| PromptPart: "uses"
PromptPartUsage }o--|| Prediction: "for"
PromptPart {
text id PK
datetime created_at
datetime updated_at
text text
}
StopSequenceUsage {
text id PK
datetime created_at
datetime updated_at
text stop_sequence FK
text prediction FK
}
StopSequenceUsage }o--|| StopSequence: "uses"
StopSequenceUsage }o--|| Prediction: "for"
StopSequence {
text id PK
datetime created_at
datetime updated_at
text text "UNIQUE"
}
SystemPrompt {
text id PK
datetime created_at
datetime updated_at
text text
text name
}
SymbolReference {
text symbol
integer start_line
integer end_line
integer start_column
integer end_column
text code_Snippet FK
}
CodeSnippet ||--o{ SymbolReference: "contains"
UserRatingType {
text symbol
integer start_line
integer end_line
text name "UNIQUE"
}
UserRating {
text symbol
integer start_line
integer end_line
float value
text user_rating_type FK
text prediction FK
}
UserRating ||--o{ UserRatingType: "is of type"
UserRating }o--|| Prediction: "rates"
This endpoint only exists for debugging purposes. It doesn't take any further parameters and always returns
{"message": "Hello, world! This is 'db_interface'."}
This endpoint returns a database object from <table_name>
with name <name>
. Note that the object has to have a column called name
. Possible tables names are:
This endpoint deletes an existing database object from <table_name>
with name <name>
. Note that the object has to have a column called name
. Possible tables names are:
This endpoint returns a list of all database objects from <table_name>
. Possible tables names are:
code_snippets
follow_up_types
follow_ups
framework_items
frameworks
llms
predictions
prompt_part_usages
prompt_parts
stop_sequence_usages
stop_sequences
symbol_references
system_prompts
user_rating_types
user_ratings
This endpoint will create a new database object. You have to provide a json body with the necessary column values. Necessary columns are all columns that don't have a NOT NULL
constraint and are not one of (id
, created_at
, updated_at
). When you provide references to other database objects you have to give them as database ids.
To create a new user rating for example you would have to make a POST
request to http://HOST:5003/user_ratings
with a body like this:
{
"value": VALUE,
"user_rating_type": "USER_RATING_TYPE_ID",
"prediction": "PREDICTION_ID"
}
On success the response status code is 201
.
This endpoint returns a database object from <table_name>
with id <id>
. You can find all possible table names here.
This endpoint updates an existing database object from <table_name>
with id <id>
. You have to provide a json body (like here) with all column values you want to update.
This endpoint deletes an existing database object from <table_name>
with id <id>
. Note that you cannot delete an object if that would violate an ON DELETE
constraint.
A call to this endpoint creates all the database tables.
A call to this endpoint drops all the database tables.
A call to this endpoint is equivalent to subsequent call to /db/drop
and /db/create
.
A call to this endpoint populates the database with some initial data. This is necessary for the entire system to work.