UNPKG

graphdb-workbench

Version:
2 lines 15.9 kB
export const __webpack_id__=73964;export const __webpack_ids__=[36633,73964];export const __webpack_modules__={36633:(e,t,n)=>{n.r(t),n.d(t,{CHAT_MESSAGE_ROLE:()=>s,ChatMessageModel:()=>r});class r{constructor(e){this._id=e.id,this._role=e.role,this._message=e.message,this._timestamp=1e3*e.timestamp,this.tokenUsageInfo=e.tokenUsageInfo,this._isTerminalState=e.isTerminalState,this._status=e.status}addToChatAnswer(e){e.messages=[this]}get id(){return this._id}set id(e){this._id=e}get role(){return this._role}set role(e){this._role=e}get message(){return this._message}set message(e){this._message=e}get timestamp(){return this._timestamp}set timestamp(e){this._timestamp=e}get isTerminalState(){return this._isTerminalState}set isTerminalState(e){this._isTerminalState=e}get status(){return this._status}set status(e){this._status=e}}const s={USER:"user",ASSISTANT:"assistant"}},73964:(e,t,n)=>{n.r(t),n.d(t,{TtygRestServiceFakeBackend:()=>o});var r=n(98980),s=n(36633);const a=2e3;class o{constructor(){this.conversations=[...i]}getConversations(){return new Promise(e=>{setTimeout(()=>e({data:(0,r.cloneDeep)(this.conversations)}),2e3)})}getConversation(e){return new Promise(t=>{setTimeout(()=>t({data:(0,r.cloneDeep)(this.conversations.find(t=>t.id===e))}),2e3)})}renameConversation(e,t){const n=this.conversations.find(t=>t.id===e);return n&&(n.name=t.name),Promise.resolve({data:(0,r.cloneDeep)(n)})}exportConversation(e){return console.info("Exporting conversation with id: ",e),Promise.resolve()}askQuestion(e){const t={id:"msg_Bn07kVDCYT1qmgu1G7Zw0KNe",conversationId:e.conversationId,agentId:null,message:`${e.question}`,role:s.CHAT_MESSAGE_ROLE.USER,timestamp:Math.floor(Date.now()/1e3)},n=this.conversations.find(t=>t.id===e.conversationId),r={id:e.conversationId,name:n?n.name:"Han Solo is a character in the Star Wars...",timestamp:Math.floor(Date.now()/1e3),messages:[{id:"msg_Bn07kVDCYT1qmgu1G7Zw0KNe_"+Date.now(),conversationId:e.conversationId,role:s.CHAT_MESSAGE_ROLE.ASSISTANT,agentId:e.agentId,message:'Certainly! Here\'s a random example that incorporates code, JSON, and a SPARQL query:\n\n### Code (Python)\n\n```python\ndef greet(name):\n return f"Hello, {name}!"\n\nprint(greet("World"))\n```\n\n### JSON\n\n```json\n{\n "greeting": "Hello",\n "target": "World",\n "language": "English"\n}\n```\n\n### SPARQL Query\n\n```sparql\nSELECT ?person ?name\nWHERE {\n ?person a ex:Person .\n ?person ex:hasName ?name .\n}\nLIMIT 10\n```\n\nThis example demonstrates a simple Python function for greeting, a JSON object representing a greeting structure, and a SPARQL query to retrieve names of persons from a dataset.',timestamp:Math.floor(Date.now()/1e3),name:null},{id:"msg_Bn07kVDCYT1qmgu1G7Zw0KNeс_"+Date.now(),conversationId:e.conversationId,role:s.CHAT_MESSAGE_ROLE.ASSISTANT,agentId:e.agentId,message:`Reply to '${e.question}' It seems there was an error with the query. Let me rectify this and try again.`,timestamp:Math.floor(Date.now()/1e3),name:null}]};return n&&(n.messages.push(t),n.messages.push(...r.messages)),new Promise(e=>setTimeout(()=>e({data:r}),2e3))}continueChatRun(e){alert("continueChatRun() not implemented")}deleteConversation(e){return this.conversations=this.conversations.filter(t=>t.id!==e),new Promise(e=>setTimeout(()=>e(),2e3))}createConversation(e){const t={id:`thread_${this.conversations.length}`,name:`Thread ${this.conversations.length}`,timestamp:Math.floor(Date.now()/1e3),messages:[]};this.conversations.unshift(t);const n=(0,r.cloneDeep)(e);return n.conversationId=t.id,this.askQuestion(n)}createChat(){return new Promise(e=>setTimeout(()=>e({data:{id:null,conversationId:"thread_1r5uVXAJKxzK5osAsTh4gyiS",agentId:null,role:null,message:null,timestamp:0,name:"New chat",usage:null,isTerminalState:!1,terminalStatusCode:null}})))}getAgents(){return new Promise(e=>setTimeout(()=>e({data:[...l]}),2e3))}getAgent(e){return Promise.resolve({data:(0,r.cloneDeep)(l.find(t=>t.id===e))})}createAgent(e){return"err"===e.name?new Promise((e,t)=>setTimeout(()=>t({status:500,message:"Internal Server Error"}),a)):(l.push(e),new Promise(t=>setTimeout(()=>t({data:e}),a)))}editAgent(e){return"err"===e.name?new Promise((e,t)=>setTimeout(()=>t({status:500,message:"Internal Server Error"}),2e3)):(l=l.map(t=>t.id===e.id?e:t),new Promise(t=>setTimeout(()=>t({data:e}),a)))}deleteAgent(e){return l=l.filter(t=>t.id!==e),Promise.resolve()}getAgentDefaultValues(){return Promise.resolve({data:u})}explainAgentSettings(){return Promise.resolve({data:{}})}simulateHttpError(){return Promise.reject({status:500,message:"Internal Server Error"})}explainResponse(e){return Promise.resolve({data:{conversationId:e.conversationId,answerId:e.answerId,queryMethods:[{name:"sparql_query",rawQuery:'SELECT ?character ?name ?height WHERE {\n ?character a voc:Character;\n rdfs:label ?name;\n voc:height ?height.\n FILTER(?name = "Luke Skywalker" || ?name = "Leia Organa")\n}',query:'SELECT ?character ?name ?height WHERE {\n ?character a voc:Character;\n rdfs:label ?name;\n voc:height ?height.\n FILTER(?name = "Luke Skywalker" || ?name = "Leia Organa")\n}',queryType:"sparql",errorOutput:"Error: org.eclipse.rdf4j.query.MalformedQueryException: org.eclipse.rdf4j.query.parser.sparql.ast.VisitorException: QName 'voc:Character' uses an undefined prefix"},{name:"retrieval_search",rawQuery:'{"queries":[{"query":"pilots that work with Luke Skywalker","filter":{"document_id":"https://swapi.co/resource/human/1"},"top_k":3}]}',query:'{\n "queries" : [ {\n "query" : "pilots that work with Luke Skywalker",\n "filter" : {\n "document_id" : "https://swapi.co/resource/human/1"\n },\n "top_k" : 3\n } ]\n}',queryType:"json",errorOutput:null},{name:"iri_discovery",rawQuery:"Luke Skywalker",query:"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\nPREFIX onto: <http://www.ontotext.com/>\nSELECT ?label ?iri {\n ?label onto:fts ('''Luke~ Skywalker~''' '*') .\n ?iri rdfs:label|skos:prefLabel ?label .\n}",queryType:"sparql",errorOutput:null},{name:"sparql_query",rawQuery:"SELECT ?height WHERE {\n <https://swapi.co/resource/human/1> voc:height ?height.\n}",query:"SELECT ?height WHERE {\n <https://swapi.co/resource/human/1> voc:height ?height.\n}",queryType:"sparql",errorOutput:"Error: org.eclipse.rdf4j.query.MalformedQueryException: org.eclipse.rdf4j.query.parser.sparql.ast.VisitorException: QName 'voc:height' uses an undefined prefix"},{name:"sparql_query",rawQuery:'PREFIX voc: <https://swapi.co/vocabulary/>\nSELECT ?name ?height WHERE {\n ?character voc:height ?height;\n rdfs:label ?name.\n FILTER(?name = "Luke Skywalker" || ?name = "Leia Organa")\n}',query:'PREFIX voc: <https://swapi.co/vocabulary/>\nSELECT ?name ?height WHERE {\n ?character voc:height ?height;\n rdfs:label ?name.\n FILTER(?name = "Luke Skywalker" || ?name = "Leia Organa")\n}',queryType:"sparql",errorOutput:null},{name:"fts_search",rawQuery:"Second Luke",query:"PREFIX onto: <http://www.ontotext.com/>\nDESCRIBE ?iri {\n\t?x onto:fts '''Second Luke''' .\n\t{\n\t\t?x ?p ?iri .\n\t} union {\n\t\t?iri ?p ?x .\n\t}\n}",queryType:"sparql",errorOutput:null},{name:"similarity_search",rawQuery:"Second Luke",query:"PREFIX onto: <http://www.ontotext.com/>\nDESCRIBE ?iri {\n\t?x onto:fts '''Second Luke''' .\n\t{\n\t\t?x ?p ?iri .\n\t} union {\n\t\t?iri ?p ?x .\n\t}\n}",queryType:"sparql",errorOutput:null},{name:"iri_discovery",rawQuery:"Luke Skywalker",query:"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\nPREFIX onto: <http://www.ontotext.com/>\nSELECT ?label ?iri {\n ?label onto:fts ('''Luke~ Skywalker~''' '*') .\n ?iri rdfs:label|skos:prefLabel ?label .\n}",queryType:"sparql",errorOutput:null},{name:"sparql_query",rawQuery:"SELECT ?name ?height WHERE { ?character voc:name ?name ; voc:height ?height . FILTER (?name = 'Luke Skywalker' || ?name = 'Leia Organa') }",query:"SELECT ?name ?height WHERE { ?character voc:name ?name ; voc:height ?height . FILTER (?name = 'Luke Skywalker' || ?name = 'Leia Organa') }",queryType:"sparql",errorOutput:"Error: java.lang.IllegalArgumentException: The following IRIs are not used in the data stored in GraphDB: https://swapi.co/vocabulary/name"},{name:"sparql_query",rawQuery:"SELECT ?character ?height WHERE { ?character voc:height ?height . FILTER (?character = <https://swapi.co/resource/human/1> || ?character = <https://swapi.co/resource/human/5>) }",query:"SELEdCT ?character ?height WHERE { ?character voc:height ?height . FILTER (?character = <https://swapi.co/resource/human/1> || ?character = <https://swapi.co/resource/human/5>) }",queryType:"sparql",errorOutput:null}]}})}cancelPendingQuestion(e){return e?Promise.reject({status:500,message:"Error while cancelling run due to: ttyg.exceptions.GenericServerException: Timeout waiting for cancellation. Run run_z12dSC remains active. Please start a new chat thread."}):Promise.resolve({status:200,message:"Current chat was successfully sent for cancelling."})}}const i=[{id:"thread_jdQBvbkaU6JPoO48oFbC54dA",name:"Very long chat name which does not fit in the sidebar",timestamp:1725235200,messages:[]},{id:"thread_jdQBvbkaU6JPoO48oQaL76dB",name:"Test chat 2",timestamp:1725238800,messages:[]},{id:"thread_jdQBvbkaU6JPoO48oQaL76dC",name:"Test chat 3",timestamp:1725242400,messages:[]},{id:"thread_jdQBvbkaU6JPoO48oFbC54dD",name:"Test chat 4",timestamp:1697331600,messages:[]}];let l=[{id:"asst_gAPcrHQQ9ZIxD5eXWH2BNFfo",name:"agent-1",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"starwars",instructions:{systemInstruction:"\n\n",userInstruction:""},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null},{id:"asst_qMyCpCBmqxV9I2B8UoMfFzc5",name:"agent-2",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"Non existing repo",instructions:{systemInstruction:"string\n\nstring",userInstruction:"string"},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null},{id:"asst_Cr0RxobrY07WpOvvyQilEWMI",name:"Databricks-general-unbiased",model:"gpt-4o-2024-08-06",temperature:1,topP:1,seed:null,repositoryId:"starwars",instructions:{systemInstruction:"You are helpful assistant in discovering information regarding diagnostic biomarkers.",userInstruction:null},assistantExtractionMethods:[],maxNumberOfTriplesPerCall:null},{id:"asst_5GxNYTdaOh7Tl6lLl6Pya2aH",name:"Databricks-biomarkers",model:"gpt-3.5-turbo-0125",temperature:1,topP:1,seed:null,repositoryId:"biomarkers",instructions:{systemInstruction:"You're a helpful assistant in discovering new diagnostic biomarkers for given diseases. I'll submit a set of publication abstracts discussing given disease and your task is to find in the abstracts any potential new biomarkers which are not yet listed in the appropriate databases. Each abstract is preceded by identifier - its PubMed id called for short PMID. \n\nReturn the set of biomarkers listed one per row, each marker followed by the | and PMID of the respective abstract if was mentioned in.\n\nExample: \nInput: 36418457\t[Amyotrophic lateral sclerosis (ALS) is a genetically and phenotypically heterogeneous disease results in the loss of motor neurons. Mounting information points to involvement of other systems including cognitive impairment. However, neither the valid biomarker for diagnosis nor effective therapeutic intervention is available for ALS. The present study is aimed at identifying potentially genetic biomarker that improves the diagnosis and treatment of ALS patients based on the data of the Gene Expression Omnibus. We retrieved datasets and conducted a weighted gene co-expression network analysis (WGCNA) to identify ALS-related co-expression genes. Functional enrichment analysis was performed to determine the features and pathways of the main modules. We then constructed an ALS-related model using the least absolute shrinkage and selection operator (LASSO) regression analysis and verified the model by the receiver operating characteristic (ROC) curve. Besides we screened the non-preserved gene modules in FTD and ALS-mimic disorders to distinct ALS-related genes from disorders with overlapping genes and features. Altogether, 4198 common genes between datasets with the most variation were analyzed and 16 distinct modules were identified through WGCNA. Blue module had the most correlation with ALS and functionally enriched in pathways of neurodegeneration-multiple diseases', 'amyotrophic lateral sclerosis', and 'endocytosis' KEGG terms. Further, some of other modules related to ALS were enriched in 'autophagy' and 'amyotrophic lateral sclerosis'. The 30 top of hub genes were recruited to a LASSO regression model and 5 genes (BCLAF1, GNA13, ARL6IP5, ARGLU1, and YPEL5) were identified as potentially diagnostic ALS biomarkers with validating of the ROC curve and AUC value.]\n\nYour response: BCLAF1|36418457\nGNA13|36418457\nARL6IP5|36418457\nARGLU1|36418457\nYPEL5|36418457",userInstruction:null},assistantExtractionMethods:[],maxNumberOfTriplesPerCall:null},{id:"asst_qMyCpCBmqxV9I2B8UoMfFzc555",name:"agent with long name long long long long long long long long long long long long",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"Non existing repo",instructions:{systemInstruction:"string\n\nstring",userInstruction:"string"},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null},{id:"asst_qMyCpCBmqxV9I2B8UoMfFzcр555",name:"Long_agent_with_long_name_long_long_long_long_long_long_long_long_long_long_long_long",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"Non existing repo",instructions:{systemInstruction:"string\n\nstring",userInstruction:"string"},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null},{id:"asst_qMyCpCBmqxV9I2B8UoMfFzc55д5",name:"agent with long name long long long long long long long long long long long long",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"starwars",instructions:{systemInstruction:"string\n\nstring",userInstruction:"string"},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null},{id:"asst_qMyCpCBmqxV9I2B8UoMfFzcя555",name:"Long_agent_with_long_name_long_long_long_long_long_long_long_long_long_long_long_long",model:"gpt-4o",temperature:0,topP:0,seed:null,repositoryId:"starwars",instructions:{systemInstruction:"string\n\nstring",userInstruction:"string"},assistantExtractionMethods:[{ftsMethod:"fts_search"}],maxNumberOfTriplesPerCall:null}];const u={id:"id",name:"Quadro",model:"gpt-4o",api:"openai-completions",contextSize:128e3,temperature:.7,topP:1,seed:0,repositoryId:"test-repository",instructions:{systemInstruction:"You are a helpful, knowledgeable, and friendly assistant. Your goal is to provide clear and accurate information while being polite, respectful, and professional.",userInstruction:"If you need to write a SPARQL query, use only the classes and properties provided in the schema and don't invent or guess any. Always try to return human-readable names or labels and not only the IRIs. If SPARQL fails to provide the necessary information you can try another tool too."},assistantExtractionMethods:[{method:"sparql_search",ontologyGraph:"http://example.com",sparqlQuery:"CONSTRUCT {?s ?p ?o} WHERE {GRAPH <http://example.org/ontology> {?s ?p ?o .}}"},{method:"fts_search",maxNumberOfTriplesPerCall:0},{method:"similarity_search",similarityIndex:"similarity-index",similarityIndexThreshold:.6,maxNumberOfTriplesPerCall:0},{method:"retrieval_search",retrievalConnectorInstance:"retrieval-connector",queryTemplate:'{"query": "string"}',maxNumberOfTriplesPerCall:0}],additionalExtractionMethods:[{method:"iri_discovery_search"}]}}}; //# sourceMappingURL=73964.8bd09950e708a9ffc873.bundle.js.map