-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.js
46 lines (43 loc) · 181 KB
/
search.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
window.pdocSearch = (function(){
/** elasticlunr - http://weixsong.github.io * Copyright (C) 2017 Oliver Nightingale * Copyright (C) 2017 Wei Song * MIT Licensed */!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u<s.length;u++){var a=s[u];r[a]=this.pipeline.run(t.tokenizer(e[a]))}var l={};for(var c in o){var d=r[c]||r.any;if(d){var f=this.fieldSearch(d,c,o),h=o[c].boost;for(var p in f)f[p]=f[p]*h;for(var p in f)p in l?l[p]+=f[p]:l[p]=f[p]}}var v,g=[];for(var p in l)v={ref:p,score:l[p]},this.documentStore.hasDoc(p)&&(v.doc=this.documentStore.getDoc(p)),g.push(v);return g.sort(function(e,t){return t.score-e.score}),g},t.Index.prototype.fieldSearch=function(e,t,n){var i=n[t].bool,o=n[t].expand,r=n[t].boost,s=null,u={};return 0!==r?(e.forEach(function(e){var n=[e];1==o&&(n=this.index[t].expandToken(e));var r={};n.forEach(function(n){var o=this.index[t].getDocs(n),a=this.idf(n,t);if(s&&"AND"==i){var l={};for(var c in s)c in o&&(l[c]=o[c]);o=l}n==e&&this.fieldSearchStats(u,n,o);for(var c in o){var d=this.index[t].getTermFrequency(n,c),f=this.documentStore.getFieldLength(c,t),h=1;0!=f&&(h=1/Math.sqrt(f));var p=1;n!=e&&(p=.15*(1-(n.length-e.length)/n.length));var v=d*a*h*p;c in r?r[c]+=v:r[c]=v}},this),s=this.mergeScores(s,r,i)},this),s=this.coordNorm(s,u,e.length)):void 0},t.Index.prototype.mergeScores=function(e,t,n){if(!e)return t;if("AND"==n){var i={};for(var o in t)o in e&&(i[o]=e[o]+t[o]);return i}for(var o in t)o in e?e[o]+=t[o]:e[o]=t[o];return e},t.Index.prototype.fieldSearchStats=function(e,t,n){for(var i in n)i in e?e[i].push(t):e[i]=[t]},t.Index.prototype.coordNorm=function(e,t,n){for(var i in e)if(i in t){var o=t[i].length;e[i]=e[i]*o/n}return e},t.Index.prototype.toJSON=function(){var e={};return this._fields.forEach(function(t){e[t]=this.index[t].toJSON()},this),{version:t.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),index:e,pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},t.DocumentStore=function(e){this._save=null===e||void 0===e?!0:e,this.docs={},this.docInfo={},this.length=0},t.DocumentStore.load=function(e){var t=new this;return t.length=e.length,t.docs=e.docs,t.docInfo=e.docInfo,t._save=e.save,t},t.DocumentStore.prototype.isDocStored=function(){return this._save},t.DocumentStore.prototype.addDoc=function(t,n){this.hasDoc(t)||this.length++,this.docs[t]=this._save===!0?e(n):null},t.DocumentStore.prototype.getDoc=function(e){return this.hasDoc(e)===!1?null:this.docs[e]},t.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},t.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},t.DocumentStore.prototype.addFieldLength=function(e,t,n){null!==e&&void 0!==e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},t.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!==e&&void 0!==e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},t.DocumentStore.prototype.getFieldLength=function(e,t){return null===e||void 0===e?0:e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},t.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},t.stemmer=function(){var e={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},t={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",i="[aeiouy]",o=n+"[^aeiouy]*",r=i+"[aeiou]*",s="^("+o+")?"+r+o,u="^("+o+")?"+r+o+"("+r+")?$",a="^("+o+")?"+r+o+r+o,l="^("+o+")?"+i,c=new RegExp(s),d=new RegExp(a),f=new RegExp(u),h=new RegExp(l),p=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,g=/^(.+?)eed$/,m=/^(.+?)(ed|ing)$/,y=/.$/,S=/(at|bl|iz)$/,x=new RegExp("([^aeiouylsz])\\1$"),w=new RegExp("^"+o+i+"[^aeiouwxy]$"),I=/^(.+?[^aeiou])y$/,b=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,E=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,D=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,F=/^(.+?)(s|t)(ion)$/,_=/^(.+?)e$/,P=/ll$/,k=new RegExp("^"+o+i+"[^aeiouwxy]$"),z=function(n){var i,o,r,s,u,a,l;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,u=v,s.test(n)?n=n.replace(s,"$1$2"):u.test(n)&&(n=n.replace(u,"$1$2")),s=g,u=m,s.test(n)){var z=s.exec(n);s=c,s.test(z[1])&&(s=y,n=n.replace(s,""))}else if(u.test(n)){var z=u.exec(n);i=z[1],u=h,u.test(i)&&(n=i,u=S,a=x,l=w,u.test(n)?n+="e":a.test(n)?(s=y,n=n.replace(s,"")):l.test(n)&&(n+="e"))}if(s=I,s.test(n)){var z=s.exec(n);i=z[1],n=i+"i"}if(s=b,s.test(n)){var z=s.exec(n);i=z[1],o=z[2],s=c,s.test(i)&&(n=i+e[o])}if(s=E,s.test(n)){var z=s.exec(n);i=z[1],o=z[2],s=c,s.test(i)&&(n=i+t[o])}if(s=D,u=F,s.test(n)){var z=s.exec(n);i=z[1],s=d,s.test(i)&&(n=i)}else if(u.test(n)){var z=u.exec(n);i=z[1]+z[2],u=d,u.test(i)&&(n=i)}if(s=_,s.test(n)){var z=s.exec(n);i=z[1],s=d,u=f,a=k,(s.test(i)||u.test(i)&&!a.test(i))&&(n=i)}return s=P,u=d,s.test(n)&&u.test(n)&&(s=y,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return z}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.stopWordFilter=function(e){return e&&t.stopWordFilter.stopWords[e]!==!0?e:void 0},t.clearStopWords=function(){t.stopWordFilter.stopWords={}},t.addStopWords=function(e){null!=e&&Array.isArray(e)!==!1&&e.forEach(function(e){t.stopWordFilter.stopWords[e]=!0},this)},t.resetStopWords=function(){t.stopWordFilter.stopWords=t.defaultStopWords},t.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,"do":!0,does:!0,either:!0,"else":!0,ever:!0,every:!0,"for":!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,"if":!0,"in":!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,"this":!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,"while":!0,who:!0,whom:!0,why:!0,will:!0,"with":!0,would:!0,yet:!0,you:!0,your:!0},t.stopWordFilter.stopWords=t.defaultStopWords,t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(e){if(null===e||void 0===e)throw new Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.InvertedIndex=function(){this.root={docs:{},df:0}},t.InvertedIndex.load=function(e){var t=new this;return t.root=e.root,t},t.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,i=0;i<=e.length-1;){var o=e[i];o in n||(n[o]={docs:{},df:0}),i+=1,n=n[o]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},t.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return!1;t=t[e[n]]}return!0},t.InvertedIndex.prototype.getNode=function(e){if(!e)return null;for(var t=this.root,n=0;n<e.length;n++){if(!t[e[n]])return null;t=t[e[n]]}return t},t.InvertedIndex.prototype.getDocs=function(e){var t=this.getNode(e);return null==t?{}:t.docs},t.InvertedIndex.prototype.getTermFrequency=function(e,t){var n=this.getNode(e);return null==n?0:t in n.docs?n.docs[t].tf:0},t.InvertedIndex.prototype.getDocFreq=function(e){var t=this.getNode(e);return null==t?0:t.df},t.InvertedIndex.prototype.removeToken=function(e,t){if(e){var n=this.getNode(e);null!=n&&t in n.docs&&(delete n.docs[t],n.df-=1)}},t.InvertedIndex.prototype.expandToken=function(e,t,n){if(null==e||""==e)return[];var t=t||[];if(void 0==n&&(n=this.getNode(e),null==n))return t;n.df>0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e<arguments.length;e++)t=arguments[e],~this.indexOf(t)||this.elements.splice(this.locationFor(t),0,t);this.length=this.elements.length},lunr.SortedSet.prototype.toArray=function(){return this.elements.slice()},lunr.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},lunr.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},lunr.SortedSet.prototype.indexOf=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]<u[i]?n++:s[n]>u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o<r.length;o++)i.add(r[o]);return i},lunr.SortedSet.prototype.toJSON=function(){return this.toArray()},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.elasticlunr=t()}(this,function(){return t})}();
/** pdoc search index */const docs = [{"fullname": "microcore", "modulename": "microcore", "kind": "module", "doc": "<h1 id=\"minimalistic-foundation-for-ai-applications\">Minimalistic Foundation for AI Applications</h1>\n\n<p><strong>microcore</strong> is a collection of python adapters for Large Language Models\nand Semantic Search APIs allowing to\ncommunicate with these services convenient way, make it easily switchable\nand separate business logic from implementation details.</p>\n"}, {"fullname": "microcore.llm", "modulename": "microcore", "qualname": "llm", "kind": "function", "doc": "<p>Request Large Language Model synchronously</p>\n\n<h6 id=\"arguments\">Arguments:</h6>\n\n<ul>\n<li><strong>prompt (str | list[str]):</strong> Text to send to LLM</li>\n<li><p><strong>**kwargs (dict):</strong> Parameters supported by the LLM API</p>\n\n<p>See parameters supported by the OpenAI:</p>\n\n<ul>\n<li><a href=\"https://platform.openai.com/docs/api-reference/completions/create\">https://platform.openai.com/docs/api-reference/completions/create</a></li>\n<li><a href=\"https://platform.openai.com/docs/api-reference/chat/create\">https://platform.openai.com/docs/api-reference/chat/create</a></li>\n</ul>\n\n<p><strong>Additional parameters:</strong></p>\n\n<pre><code>- callback: callable - callback function\nto be called on each chunk of text,\nenables response streaming if supported by the LLM API\n- callbacks: list[callable] - collection of callbacks\nto be called on each chunk of text,\nenables response streaming if supported by the LLM API\n</code></pre></li>\n</ul>\n\n<h6 id=\"returns\">Returns:</h6>\n\n<blockquote>\n <p>Text generated by the LLM as string\n with all fields returned by API accessible as an attributes.</p>\n \n <p>See fields returned by the OpenAI:</p>\n \n <ul>\n <li><a href=\"https://platform.openai.com/docs/api-reference/completions/object\">https://platform.openai.com/docs/api-reference/completions/object</a></li>\n <li><a href=\"https://platform.openai.com/docs/api-reference/chat/object\">https://platform.openai.com/docs/api-reference/chat/object</a></li>\n </ul>\n</blockquote>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">prompt</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">message_types</span><span class=\"o\">.</span><span class=\"n\">Msg</span> <span class=\"o\">|</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]</span> <span class=\"o\">|</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">message_types</span><span class=\"o\">.</span><span class=\"n\">Msg</span><span class=\"p\">]</span>,</span><span class=\"param\">\t<span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">wrappers</span><span class=\"o\">.</span><span class=\"n\">llm_response_wrapper</span><span class=\"o\">.</span><span class=\"n\">LLMResponse</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.allm", "modulename": "microcore", "qualname": "allm", "kind": "function", "doc": "<p>Request Large Language Model asynchronously</p>\n\n<h6 id=\"arguments\">Arguments:</h6>\n\n<ul>\n<li><strong>prompt (str | list[str]):</strong> Text to send to LLM</li>\n<li><p><strong>**kwargs (dict):</strong> Parameters supported by the LLM API</p>\n\n<p>See parameters supported by the OpenAI:</p>\n\n<ul>\n<li><a href=\"https://platform.openai.com/docs/api-reference/completions/create\">https://platform.openai.com/docs/api-reference/completions/create</a></li>\n<li><a href=\"https://platform.openai.com/docs/api-reference/chat/create\">https://platform.openai.com/docs/api-reference/chat/create</a></li>\n</ul>\n\n<p><strong>Additional parameters:</strong></p>\n\n<ul>\n<li>callback: callable - callback function\nto be called on each chunk of text,\nenables response streaming if supported by the LLM API</li>\n<li>callbacks: list[callable] - collection of callbacks\nto be called on each chunk of text,\nenables response streaming if supported by the LLM API</li>\n</ul>\n\n<p>Note: async callbacks are supported only for async LLM API calls</p></li>\n</ul>\n\n<h6 id=\"returns\">Returns:</h6>\n\n<blockquote>\n <p>Text generated by the LLM as string\n with all fields returned by API accessible as an attributes.</p>\n \n <p>See fields returned by the OpenAI:</p>\n \n <ul>\n <li><a href=\"https://platform.openai.com/docs/api-reference/completions/object\">https://platform.openai.com/docs/api-reference/completions/object</a></li>\n <li><a href=\"https://platform.openai.com/docs/api-reference/chat/object\">https://platform.openai.com/docs/api-reference/chat/object</a></li>\n </ul>\n</blockquote>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">prompt</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">message_types</span><span class=\"o\">.</span><span class=\"n\">Msg</span> <span class=\"o\">|</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]</span> <span class=\"o\">|</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">message_types</span><span class=\"o\">.</span><span class=\"n\">Msg</span><span class=\"p\">]</span>,</span><span class=\"param\">\t<span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">wrappers</span><span class=\"o\">.</span><span class=\"n\">llm_response_wrapper</span><span class=\"o\">.</span><span class=\"n\">LLMResponse</span>:</span></span>", "funcdef": "async def"}, {"fullname": "microcore.llm_parallel", "modulename": "microcore", "qualname": "llm_parallel", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">prompts</span><span class=\"p\">:</span> <span class=\"nb\">list</span>,</span><span class=\"param\">\t<span class=\"n\">max_concurrent_tasks</span><span class=\"p\">:</span> <span class=\"nb\">int</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]</span> <span class=\"o\">|</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">wrappers</span><span class=\"o\">.</span><span class=\"n\">llm_response_wrapper</span><span class=\"o\">.</span><span class=\"n\">LLMResponse</span><span class=\"p\">]</span>:</span></span>", "funcdef": "async def"}, {"fullname": "microcore.tpl", "modulename": "microcore", "qualname": "tpl", "kind": "function", "doc": "<p>Renders a prompt template using the provided parameters.</p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">file</span><span class=\"p\">:</span> <span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">PathLike</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]</span> <span class=\"o\">|</span> <span class=\"nb\">str</span>,</span><span class=\"param\">\t<span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">wrappers</span><span class=\"o\">.</span><span class=\"n\">prompt_wrapper</span><span class=\"o\">.</span><span class=\"n\">PromptWrapper</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.prompt", "modulename": "microcore", "qualname": "prompt", "kind": "function", "doc": "<p>Renders a prompt template from string using the provided parameters.</p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">template_str</span><span class=\"p\">:</span> <span class=\"nb\">str</span>,</span><span class=\"param\">\t<span class=\"n\">remove_indent</span><span class=\"o\">=</span><span class=\"kc\">True</span>,</span><span class=\"param\">\t<span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">wrappers</span><span class=\"o\">.</span><span class=\"n\">prompt_wrapper</span><span class=\"o\">.</span><span class=\"n\">PromptWrapper</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.fmt", "modulename": "microcore", "qualname": "fmt", "kind": "function", "doc": "<p>Renders a prompt template from string using the provided parameters.</p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">template_str</span><span class=\"p\">:</span> <span class=\"nb\">str</span>,</span><span class=\"param\">\t<span class=\"n\">remove_indent</span><span class=\"o\">=</span><span class=\"kc\">True</span>,</span><span class=\"param\">\t<span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">wrappers</span><span class=\"o\">.</span><span class=\"n\">prompt_wrapper</span><span class=\"o\">.</span><span class=\"n\">PromptWrapper</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.texts", "modulename": "microcore", "qualname": "texts", "kind": "variable", "doc": "<p>Embedding database, see <code>microcore.embedding_db.AbstractEmbeddingDB</code></p>\n", "default_value": "_EmbeddingDBProxy()"}, {"fullname": "microcore.configure", "modulename": "microcore", "qualname": "configure", "kind": "function", "doc": "<ul>\n<li>Convert configuration keys to uppercase</li>\n<li>Add LLM_ prefix to keys if necessary</li>\n<li>Allow to configure from Config instance or dictionary</li>\n</ul>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">cfg</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span> <span class=\"o\">|</span> <span class=\"nb\">dict</span> <span class=\"o\">|</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>, </span><span class=\"param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.validate_config", "modulename": "microcore", "qualname": "validate_config", "kind": "function", "doc": "<p>Validates current MicroCore configuration</p>\n\n<h6 id=\"raises\">Raises:</h6>\n\n<ul>\n<li><code>LLMConfigError</code> if configuration is invalid</li>\n</ul>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.storage", "modulename": "microcore", "qualname": "storage", "kind": "variable", "doc": "<p></p>\n", "default_value": "<microcore.file_storage.Storage object>"}, {"fullname": "microcore.use_model", "modulename": "microcore", "qualname": "use_model", "kind": "function", "doc": "<p>Switches language model</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">name</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.use_logging", "modulename": "microcore", "qualname": "use_logging", "kind": "function", "doc": "<p>Turns on logging of LLM requests and responses to console.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.env", "modulename": "microcore", "qualname": "env", "kind": "function", "doc": "<p>Returns the current MicroCore environment</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"return-annotation\">) -> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">_env</span><span class=\"o\">.</span><span class=\"n\">Env</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.config", "modulename": "microcore", "qualname": "config", "kind": "function", "doc": "<p>Resolve current configuration</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"return-annotation\">) -> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.Msg", "modulename": "microcore", "qualname": "Msg", "kind": "class", "doc": "<p></p>\n"}, {"fullname": "microcore.Msg.__init__", "modulename": "microcore", "qualname": "Msg.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">role</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">'user'</span>, </span><span class=\"param\"><span class=\"n\">content</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">''</span></span>)</span>"}, {"fullname": "microcore.Msg.dict_factory", "modulename": "microcore", "qualname": "Msg.dict_factory", "kind": "variable", "doc": "<p></p>\n", "default_value": "<class 'dict'>"}, {"fullname": "microcore.Msg.role", "modulename": "microcore", "qualname": "Msg.role", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "'user'"}, {"fullname": "microcore.Msg.content", "modulename": "microcore", "qualname": "Msg.content", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "''"}, {"fullname": "microcore.Msg.strip", "modulename": "microcore", "qualname": "Msg.strip", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.UserMsg", "modulename": "microcore", "qualname": "UserMsg", "kind": "class", "doc": "<p></p>\n", "bases": "microcore.message_types.Msg"}, {"fullname": "microcore.UserMsg.__init__", "modulename": "microcore", "qualname": "UserMsg.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">content</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">''</span></span>)</span>"}, {"fullname": "microcore.UserMsg.role", "modulename": "microcore", "qualname": "UserMsg.role", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "'user'"}, {"fullname": "microcore.SysMsg", "modulename": "microcore", "qualname": "SysMsg", "kind": "class", "doc": "<p></p>\n", "bases": "microcore.message_types.Msg"}, {"fullname": "microcore.SysMsg.__init__", "modulename": "microcore", "qualname": "SysMsg.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">content</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">''</span></span>)</span>"}, {"fullname": "microcore.SysMsg.role", "modulename": "microcore", "qualname": "SysMsg.role", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "'system'"}, {"fullname": "microcore.AssistantMsg", "modulename": "microcore", "qualname": "AssistantMsg", "kind": "class", "doc": "<p></p>\n", "bases": "microcore.message_types.Msg"}, {"fullname": "microcore.AssistantMsg.__init__", "modulename": "microcore", "qualname": "AssistantMsg.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">content</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">''</span></span>)</span>"}, {"fullname": "microcore.AssistantMsg.role", "modulename": "microcore", "qualname": "AssistantMsg.role", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "'assistant'"}, {"fullname": "microcore.PartialMsg", "modulename": "microcore", "qualname": "PartialMsg", "kind": "class", "doc": "<p>A message that is not fully formed yet.</p>\n", "bases": "microcore.message_types.AssistantMsg"}, {"fullname": "microcore.PartialMsg.dict_factory", "modulename": "microcore", "qualname": "PartialMsg.dict_factory", "kind": "variable", "doc": "<p></p>\n", "default_value": "<class 'microcore.message_types.PartialMsg._PartialMsgDict'>"}, {"fullname": "microcore.PartialMsg.placeholder", "modulename": "microcore", "qualname": "PartialMsg.placeholder", "kind": "variable", "doc": "<p></p>\n", "default_value": "'<|placeholder|>'"}, {"fullname": "microcore.PartialMsg.variants_splitter", "modulename": "microcore", "qualname": "PartialMsg.variants_splitter", "kind": "variable", "doc": "<p></p>\n", "default_value": "'<|or|>'"}, {"fullname": "microcore.PartialMsg.split_prefix_and_suffixes", "modulename": "microcore", "qualname": "PartialMsg.split_prefix_and_suffixes", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">content</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.PartialMsg.prefix_and_suffixes", "modulename": "microcore", "qualname": "PartialMsg.prefix_and_suffixes", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.PartialMsg.prefix", "modulename": "microcore", "qualname": "PartialMsg.prefix", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.PartialMsg.suffixes", "modulename": "microcore", "qualname": "PartialMsg.suffixes", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ApiType", "modulename": "microcore", "qualname": "ApiType", "kind": "class", "doc": "<p>LLM API types</p>\n"}, {"fullname": "microcore.ApiType.OPEN_AI", "modulename": "microcore", "qualname": "ApiType.OPEN_AI", "kind": "variable", "doc": "<p></p>\n", "default_value": "'open_ai'"}, {"fullname": "microcore.ApiType.AZURE", "modulename": "microcore", "qualname": "ApiType.AZURE", "kind": "variable", "doc": "<p>See <a href=\"https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models\">https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models</a></p>\n", "default_value": "'azure'"}, {"fullname": "microcore.ApiType.ANYSCALE", "modulename": "microcore", "qualname": "ApiType.ANYSCALE", "kind": "variable", "doc": "<p>See <a href=\"https://www.anyscale.com/endpoints\">https://www.anyscale.com/endpoints</a></p>\n", "default_value": "'anyscale'"}, {"fullname": "microcore.ApiType.DEEP_INFRA", "modulename": "microcore", "qualname": "ApiType.DEEP_INFRA", "kind": "variable", "doc": "<p>List of text generation models: <a href=\"https://deepinfra.com/models?type=text-generation\">https://deepinfra.com/models?type=text-generation</a></p>\n", "default_value": "'deep_infra'"}, {"fullname": "microcore.ApiType.ANTHROPIC", "modulename": "microcore", "qualname": "ApiType.ANTHROPIC", "kind": "variable", "doc": "<p></p>\n", "default_value": "'anthropic'"}, {"fullname": "microcore.ApiType.GOOGLE_VERTEX_AI", "modulename": "microcore", "qualname": "ApiType.GOOGLE_VERTEX_AI", "kind": "variable", "doc": "<p></p>\n", "default_value": "'google_vertex_ai'"}, {"fullname": "microcore.ApiType.GOOGLE_AI_STUDIO", "modulename": "microcore", "qualname": "ApiType.GOOGLE_AI_STUDIO", "kind": "variable", "doc": "<p></p>\n", "default_value": "'google_ai_studio'"}, {"fullname": "microcore.ApiType.FUNCTION", "modulename": "microcore", "qualname": "ApiType.FUNCTION", "kind": "variable", "doc": "<p></p>\n", "default_value": "'function'"}, {"fullname": "microcore.ApiType.TRANSFORMERS", "modulename": "microcore", "qualname": "ApiType.TRANSFORMERS", "kind": "variable", "doc": "<p></p>\n", "default_value": "'transformers'"}, {"fullname": "microcore.ApiType.NONE", "modulename": "microcore", "qualname": "ApiType.NONE", "kind": "variable", "doc": "<p></p>\n", "default_value": "'none'"}, {"fullname": "microcore.ApiType.is_local", "modulename": "microcore", "qualname": "ApiType.is_local", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">api_type</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">bool</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.BadAIJsonAnswer", "modulename": "microcore", "qualname": "BadAIJsonAnswer", "kind": "class", "doc": "<p>Unprocessable response generated by the LLM</p>\n", "bases": "microcore.types.BadAIAnswer"}, {"fullname": "microcore.BadAIJsonAnswer.__init__", "modulename": "microcore", "qualname": "BadAIJsonAnswer.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">message</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">'Invalid JSON generated by the LLM'</span>, </span><span class=\"param\"><span class=\"n\">details</span><span class=\"o\">=</span><span class=\"kc\">None</span></span>)</span>"}, {"fullname": "microcore.BadAIAnswer", "modulename": "microcore", "qualname": "BadAIAnswer", "kind": "class", "doc": "<p>Unprocessable response generated by the LLM</p>\n", "bases": "builtins.ValueError"}, {"fullname": "microcore.BadAIAnswer.__init__", "modulename": "microcore", "qualname": "BadAIAnswer.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">message</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>, </span><span class=\"param\"><span class=\"n\">details</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span>)</span>"}, {"fullname": "microcore.BadAIAnswer.message", "modulename": "microcore", "qualname": "BadAIAnswer.message", "kind": "variable", "doc": "<p></p>\n"}, {"fullname": "microcore.BadAIAnswer.details", "modulename": "microcore", "qualname": "BadAIAnswer.details", "kind": "variable", "doc": "<p></p>\n"}, {"fullname": "microcore.LLMConfigError", "modulename": "microcore", "qualname": "LLMConfigError", "kind": "class", "doc": "<p>LLM configuration error</p>\n", "bases": "builtins.ValueError"}, {"fullname": "microcore.LLMResponse", "modulename": "microcore", "qualname": "LLMResponse", "kind": "class", "doc": "<p>Response from the Large Language Model.</p>\n\n<p>If treated as a string, it returns the text generated by the LLM.</p>\n\n<p>Also, it contains all fields returned by the API accessible as an attributes.</p>\n\n<p>See fields returned by the OpenAI:</p>\n\n<ul>\n<li><a href=\"https://platform.openai.com/docs/api-reference/completions/object\">https://platform.openai.com/docs/api-reference/completions/object</a></li>\n<li><a href=\"https://platform.openai.com/docs/api-reference/chat/object\">https://platform.openai.com/docs/api-reference/chat/object</a></li>\n</ul>\n", "bases": "microcore.utils.ExtendedString, microcore.utils.ConvertableToMessage"}, {"fullname": "microcore.LLMResponse.parse_json", "modulename": "microcore", "qualname": "LLMResponse.parse_json", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">raise_errors</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>,</span><span class=\"param\">\t<span class=\"n\">required_fields</span><span class=\"p\">:</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">list</span> <span class=\"o\">|</span> <span class=\"nb\">dict</span> <span class=\"o\">|</span> <span class=\"nb\">float</span> <span class=\"o\">|</span> <span class=\"nb\">int</span> <span class=\"o\">|</span> <span class=\"nb\">str</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.LLMResponse.parse_number", "modulename": "microcore", "qualname": "LLMResponse.parse_number", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\tdefault=<class 'microcore.types.BadAIAnswer'>,</span><span class=\"param\">\t<span class=\"n\">position</span><span class=\"o\">=</span><span class=\"s1\">'last'</span>,</span><span class=\"param\">\tdtype: type | str = <class 'float'>,</span><span class=\"param\">\t<span class=\"n\">rounding</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">False</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">int</span> <span class=\"o\">|</span> <span class=\"nb\">float</span> <span class=\"o\">|</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.LLMResponse.as_message", "modulename": "microcore", "qualname": "LLMResponse.as_message", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">) -> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">message_types</span><span class=\"o\">.</span><span class=\"n\">AssistantMsg</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.PromptWrapper", "modulename": "microcore", "qualname": "PromptWrapper", "kind": "class", "doc": "<p>Provides a way of extending string with attributes and methods</p>\n", "bases": "microcore.utils.ExtendedString, microcore.utils.ConvertableToMessage"}, {"fullname": "microcore.PromptWrapper.__init__", "modulename": "microcore", "qualname": "PromptWrapper.__init__", "kind": "function", "doc": "<p>Allows string to have attributes.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">string</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">attrs</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span>)</span>"}, {"fullname": "microcore.PromptWrapper.to_llm", "modulename": "microcore", "qualname": "PromptWrapper.to_llm", "kind": "function", "doc": "<p>Send prompt to Large Language Model, see <code>llm</code></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.PromptWrapper.to_allm", "modulename": "microcore", "qualname": "PromptWrapper.to_allm", "kind": "function", "doc": "<p>Send prompt to Large Language Model asynchronously, see <code>allm</code></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "async def"}, {"fullname": "microcore.parse", "modulename": "microcore", "qualname": "parse", "kind": "function", "doc": "<p>Parse a document divided into sections and convert it into a dictionary.</p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">text</span><span class=\"p\">:</span> <span class=\"nb\">str</span>,</span><span class=\"param\">\t<span class=\"n\">field_format</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">'</span><span class=\"se\">\\\\</span><span class=\"s1\">[</span><span class=\"se\">\\\\</span><span class=\"s1\">[(.*?)</span><span class=\"se\">\\\\</span><span class=\"s1\">]</span><span class=\"se\">\\\\</span><span class=\"s1\">]'</span>,</span><span class=\"param\">\t<span class=\"n\">required_fields</span><span class=\"p\">:</span> <span class=\"nb\">list</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">dict</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.SearchResult", "modulename": "microcore", "qualname": "SearchResult", "kind": "class", "doc": "<p>String containing the search result with additional information in attributes</p>\n\n<h6 id=\"attributes\">Attributes:</h6>\n\n<ul>\n<li><strong>id (str):</strong> document (text) identifier in embedding database</li>\n<li><strong>distance (float):</strong> The distance between the query and the search result</li>\n<li><strong>metadata (dict):</strong> A dictionary containing document metadata</li>\n</ul>\n", "bases": "microcore.utils.ExtendedString"}, {"fullname": "microcore.SearchResult.__init__", "modulename": "microcore", "qualname": "SearchResult.__init__", "kind": "function", "doc": "<p>Allows string to have attributes.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">string</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">attrs</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span>)</span>"}, {"fullname": "microcore.SearchResult.id", "modulename": "microcore", "qualname": "SearchResult.id", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str"}, {"fullname": "microcore.SearchResult.distance", "modulename": "microcore", "qualname": "SearchResult.distance", "kind": "variable", "doc": "<p></p>\n", "annotation": ": float"}, {"fullname": "microcore.SearchResult.metadata", "modulename": "microcore", "qualname": "SearchResult.metadata", "kind": "variable", "doc": "<p></p>\n", "annotation": ": dict"}, {"fullname": "microcore.SearchResults", "modulename": "microcore", "qualname": "SearchResults", "kind": "class", "doc": "<p>Built-in mutable sequence.</p>\n\n<p>If no argument is given, the constructor creates a new empty list.\nThe argument must be an iterable if specified.</p>\n", "bases": "builtins.list"}, {"fullname": "microcore.SearchResults.fit_to_token_size", "modulename": "microcore", "qualname": "SearchResults.fit_to_token_size", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">max_tokens</span><span class=\"p\">:</span> <span class=\"nb\">int</span>,</span><span class=\"param\">\t<span class=\"n\">for_model</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">encoding</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">tiktoken</span><span class=\"o\">.</span><span class=\"n\">core</span><span class=\"o\">.</span><span class=\"n\">Encoding</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">verbose</span><span class=\"o\">=</span><span class=\"kc\">True</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.dedent", "modulename": "microcore", "qualname": "dedent", "kind": "function", "doc": "<p>Removes minimal shared leading whitespace from each line\nand strips leading and trailing empty lines.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">text</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">str</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.Config", "modulename": "microcore", "qualname": "Config", "kind": "class", "doc": "<p>MicroCore configuration</p>\n", "bases": "microcore.configuration.LLMConfig"}, {"fullname": "microcore.Config.__init__", "modulename": "microcore", "qualname": "Config.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_ACCESS_TOKEN</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_PROJECT_ID</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_LOCATION</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_GCLOUD_AUTH</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_RESPONSE_VALIDATION</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_GEMINI_SAFETY_SETTINGS</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">ANTHROPIC_API_KEY</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_TYPE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_KEY</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_BASE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_VERSION</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">USE_DOT_ENV</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">DOT_ENV_FILE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_TYPE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_KEY</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_BASE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_VERSION</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_DEPLOYMENT_ID</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">MODEL</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">TIKTOKEN_ENCODING</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_DEFAULT_ARGS</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">AZURE_DEPLOYMENT_ID</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">INFERENCE_FUNC</span><span class=\"p\">:</span> <span class=\"n\">Union</span><span class=\"p\">[</span><span class=\"n\">Callable</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">CHAT_MODE</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">INIT_PARAMS</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">USE_LOGGING</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">PROMPT_TEMPLATES_PATH</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">STORAGE_PATH</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">STORAGE_DEFAULT_FILE_EXT</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">EMBEDDING_DB_FOLDER</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">EMBEDDING_DB_FUNCTION</span><span class=\"p\">:</span> <span class=\"n\">Any</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">EMBEDDING_DB_ALLOW_DUPLICATES</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">DEFAULT_ENCODING</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">JINJA2_AUTO_ESCAPE</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">ELEVENLABS_API_KEY</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">TEXT_TO_SPEECH_PATH</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">MAX_CONCURRENT_TASKS</span><span class=\"p\">:</span> <span class=\"nb\">int</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span></span>)</span>"}, {"fullname": "microcore.Config.USE_LOGGING", "modulename": "microcore", "qualname": "Config.USE_LOGGING", "kind": "variable", "doc": "<p>Whether to use logging or not, see <code>microcore.use_logging</code></p>\n", "annotation": ": bool", "default_value": "<object object>"}, {"fullname": "microcore.Config.PROMPT_TEMPLATES_PATH", "modulename": "microcore", "qualname": "Config.PROMPT_TEMPLATES_PATH", "kind": "variable", "doc": "<p>Path to the folder with prompt templates, ./tpl by default</p>\n", "annotation": ": str | pathlib.Path", "default_value": "<object object>"}, {"fullname": "microcore.Config.STORAGE_PATH", "modulename": "microcore", "qualname": "Config.STORAGE_PATH", "kind": "variable", "doc": "<p>Path to the folder with file storage, ./storage by default</p>\n", "annotation": ": str | pathlib.Path", "default_value": "<object object>"}, {"fullname": "microcore.Config.STORAGE_DEFAULT_FILE_EXT", "modulename": "microcore", "qualname": "Config.STORAGE_DEFAULT_FILE_EXT", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.Config.EMBEDDING_DB_FOLDER", "modulename": "microcore", "qualname": "Config.EMBEDDING_DB_FOLDER", "kind": "variable", "doc": "<p>Folder within microcore.config.Config.STORAGE_PATH for storing embeddings</p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.Config.EMBEDDING_DB_FUNCTION", "modulename": "microcore", "qualname": "Config.EMBEDDING_DB_FUNCTION", "kind": "variable", "doc": "<p></p>\n", "annotation": ": Any", "default_value": "<object object>"}, {"fullname": "microcore.Config.EMBEDDING_DB_ALLOW_DUPLICATES", "modulename": "microcore", "qualname": "Config.EMBEDDING_DB_ALLOW_DUPLICATES", "kind": "variable", "doc": "<p></p>\n", "annotation": ": bool", "default_value": "<object object>"}, {"fullname": "microcore.Config.DEFAULT_ENCODING", "modulename": "microcore", "qualname": "Config.DEFAULT_ENCODING", "kind": "variable", "doc": "<p>Used in file system operations, utf-8 by default</p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.Config.JINJA2_AUTO_ESCAPE", "modulename": "microcore", "qualname": "Config.JINJA2_AUTO_ESCAPE", "kind": "variable", "doc": "<p></p>\n", "annotation": ": bool", "default_value": "<object object>"}, {"fullname": "microcore.Config.ELEVENLABS_API_KEY", "modulename": "microcore", "qualname": "Config.ELEVENLABS_API_KEY", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.Config.TEXT_TO_SPEECH_PATH", "modulename": "microcore", "qualname": "Config.TEXT_TO_SPEECH_PATH", "kind": "variable", "doc": "<p>Path to the folder with generated voice files</p>\n", "annotation": ": str | pathlib.Path", "default_value": "<object object>"}, {"fullname": "microcore.Config.MAX_CONCURRENT_TASKS", "modulename": "microcore", "qualname": "Config.MAX_CONCURRENT_TASKS", "kind": "variable", "doc": "<p></p>\n", "annotation": ": int", "default_value": "<object object>"}, {"fullname": "microcore.Metrics", "modulename": "microcore", "qualname": "Metrics", "kind": "class", "doc": "<p></p>\n"}, {"fullname": "microcore.Metrics.exec_duration", "modulename": "microcore", "qualname": "Metrics.exec_duration", "kind": "variable", "doc": "<p></p>\n", "annotation": ": float"}, {"fullname": "microcore.Metrics.total_gen_duration", "modulename": "microcore", "qualname": "Metrics.total_gen_duration", "kind": "variable", "doc": "<p></p>\n", "annotation": ": float"}, {"fullname": "microcore.Metrics.requests_count", "modulename": "microcore", "qualname": "Metrics.requests_count", "kind": "variable", "doc": "<p></p>\n", "annotation": ": int"}, {"fullname": "microcore.Metrics.succ_requests_count", "modulename": "microcore", "qualname": "Metrics.succ_requests_count", "kind": "variable", "doc": "<p></p>\n", "annotation": ": int"}, {"fullname": "microcore.Metrics.gen_chars_count", "modulename": "microcore", "qualname": "Metrics.gen_chars_count", "kind": "variable", "doc": "<p></p>\n", "annotation": ": int"}, {"fullname": "microcore.Metrics.avg_gen_duration", "modulename": "microcore", "qualname": "Metrics.avg_gen_duration", "kind": "variable", "doc": "<p></p>\n", "annotation": ": float"}, {"fullname": "microcore.Metrics.gen_chars_speed", "modulename": "microcore", "qualname": "Metrics.gen_chars_speed", "kind": "variable", "doc": "<p></p>\n", "annotation": ": float"}, {"fullname": "microcore.configuration", "modulename": "microcore.configuration", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.configuration.from_env", "modulename": "microcore.configuration", "qualname": "from_env", "kind": "function", "doc": "<p>Provides default value for the configuration dataclass\nfrom the environment variable with the name equal to field name in upper case</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">default</span><span class=\"o\">=</span><span class=\"kc\">None</span>, </span><span class=\"param\"><span class=\"n\">dtype</span><span class=\"o\">=</span><span class=\"kc\">None</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.configuration.get_bool_from_env", "modulename": "microcore.configuration", "qualname": "get_bool_from_env", "kind": "function", "doc": "<p>Convert value of environment variable to boolean</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">env_var</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">default</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">|</span> <span class=\"kc\">None</span> <span class=\"o\">=</span> <span class=\"kc\">False</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">bool</span> <span class=\"o\">|</span> <span class=\"kc\">None</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.configuration.get_object_from_env", "modulename": "microcore.configuration", "qualname": "get_object_from_env", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">env_var</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">dtype</span><span class=\"p\">:</span> <span class=\"nb\">type</span>, </span><span class=\"param\"><span class=\"n\">default</span><span class=\"p\">:</span> <span class=\"n\">Any</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.configuration.ApiType", "modulename": "microcore.configuration", "qualname": "ApiType", "kind": "class", "doc": "<p>LLM API types</p>\n"}, {"fullname": "microcore.configuration.ApiType.OPEN_AI", "modulename": "microcore.configuration", "qualname": "ApiType.OPEN_AI", "kind": "variable", "doc": "<p></p>\n", "default_value": "'open_ai'"}, {"fullname": "microcore.configuration.ApiType.AZURE", "modulename": "microcore.configuration", "qualname": "ApiType.AZURE", "kind": "variable", "doc": "<p>See <a href=\"https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models\">https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models</a></p>\n", "default_value": "'azure'"}, {"fullname": "microcore.configuration.ApiType.ANYSCALE", "modulename": "microcore.configuration", "qualname": "ApiType.ANYSCALE", "kind": "variable", "doc": "<p>See <a href=\"https://www.anyscale.com/endpoints\">https://www.anyscale.com/endpoints</a></p>\n", "default_value": "'anyscale'"}, {"fullname": "microcore.configuration.ApiType.DEEP_INFRA", "modulename": "microcore.configuration", "qualname": "ApiType.DEEP_INFRA", "kind": "variable", "doc": "<p>List of text generation models: <a href=\"https://deepinfra.com/models?type=text-generation\">https://deepinfra.com/models?type=text-generation</a></p>\n", "default_value": "'deep_infra'"}, {"fullname": "microcore.configuration.ApiType.ANTHROPIC", "modulename": "microcore.configuration", "qualname": "ApiType.ANTHROPIC", "kind": "variable", "doc": "<p></p>\n", "default_value": "'anthropic'"}, {"fullname": "microcore.configuration.ApiType.GOOGLE_VERTEX_AI", "modulename": "microcore.configuration", "qualname": "ApiType.GOOGLE_VERTEX_AI", "kind": "variable", "doc": "<p></p>\n", "default_value": "'google_vertex_ai'"}, {"fullname": "microcore.configuration.ApiType.GOOGLE_AI_STUDIO", "modulename": "microcore.configuration", "qualname": "ApiType.GOOGLE_AI_STUDIO", "kind": "variable", "doc": "<p></p>\n", "default_value": "'google_ai_studio'"}, {"fullname": "microcore.configuration.ApiType.FUNCTION", "modulename": "microcore.configuration", "qualname": "ApiType.FUNCTION", "kind": "variable", "doc": "<p></p>\n", "default_value": "'function'"}, {"fullname": "microcore.configuration.ApiType.TRANSFORMERS", "modulename": "microcore.configuration", "qualname": "ApiType.TRANSFORMERS", "kind": "variable", "doc": "<p></p>\n", "default_value": "'transformers'"}, {"fullname": "microcore.configuration.ApiType.NONE", "modulename": "microcore.configuration", "qualname": "ApiType.NONE", "kind": "variable", "doc": "<p></p>\n", "default_value": "'none'"}, {"fullname": "microcore.configuration.ApiType.is_local", "modulename": "microcore.configuration", "qualname": "ApiType.is_local", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">api_type</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">bool</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.configuration.BaseConfig", "modulename": "microcore.configuration", "qualname": "BaseConfig", "kind": "class", "doc": "<p>Base class for configuration dataclasses</p>\n"}, {"fullname": "microcore.configuration.BaseConfig.__init__", "modulename": "microcore.configuration", "qualname": "BaseConfig.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">USE_DOT_ENV</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>, </span><span class=\"param\"><span class=\"n\">DOT_ENV_FILE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span>)</span>"}, {"fullname": "microcore.configuration.BaseConfig.USE_DOT_ENV", "modulename": "microcore.configuration", "qualname": "BaseConfig.USE_DOT_ENV", "kind": "variable", "doc": "<p></p>\n", "annotation": ": bool", "default_value": "None"}, {"fullname": "microcore.configuration.BaseConfig.DOT_ENV_FILE", "modulename": "microcore.configuration", "qualname": "BaseConfig.DOT_ENV_FILE", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str | pathlib.Path", "default_value": "None"}, {"fullname": "microcore.configuration.LLMConfig", "modulename": "microcore.configuration", "qualname": "LLMConfig", "kind": "class", "doc": "<p>LLM configuration</p>\n", "bases": "BaseConfig, _OpenAIEnvVars, _AnthropicEnvVars, _GoogleVertexAiEnvVars"}, {"fullname": "microcore.configuration.LLMConfig.__init__", "modulename": "microcore.configuration", "qualname": "LLMConfig.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_ACCESS_TOKEN</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_PROJECT_ID</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_LOCATION</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_GCLOUD_AUTH</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_RESPONSE_VALIDATION</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_GEMINI_SAFETY_SETTINGS</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">ANTHROPIC_API_KEY</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_TYPE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_KEY</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_BASE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_VERSION</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">USE_DOT_ENV</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">DOT_ENV_FILE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_TYPE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_KEY</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_BASE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_VERSION</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_DEPLOYMENT_ID</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">MODEL</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">TIKTOKEN_ENCODING</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_DEFAULT_ARGS</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">AZURE_DEPLOYMENT_ID</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">INFERENCE_FUNC</span><span class=\"p\">:</span> <span class=\"n\">Union</span><span class=\"p\">[</span><span class=\"n\">Callable</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">CHAT_MODE</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">INIT_PARAMS</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span></span>)</span>"}, {"fullname": "microcore.configuration.LLMConfig.LLM_API_TYPE", "modulename": "microcore.configuration", "qualname": "LLMConfig.LLM_API_TYPE", "kind": "variable", "doc": "<p>See <code>ApiType</code>.\nTo use services that is not listed in <code>ApiType</code>,\nbut provides OpenAPI interface, use <code>ApiType.OPEN_AI</code></p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.LLM_API_KEY", "modulename": "microcore.configuration", "qualname": "LLMConfig.LLM_API_KEY", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.LLM_API_BASE", "modulename": "microcore.configuration", "qualname": "LLMConfig.LLM_API_BASE", "kind": "variable", "doc": "<p>Base URL for the LLM API, e.g. <a href=\"https://api.openai.com/v1\">https://api.openai.com/v1</a></p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.LLM_API_VERSION", "modulename": "microcore.configuration", "qualname": "LLMConfig.LLM_API_VERSION", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.LLM_DEPLOYMENT_ID", "modulename": "microcore.configuration", "qualname": "LLMConfig.LLM_DEPLOYMENT_ID", "kind": "variable", "doc": "<p>Required by <code>ApiType.AZURE</code></p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.MODEL", "modulename": "microcore.configuration", "qualname": "LLMConfig.MODEL", "kind": "variable", "doc": "<p>Language model name</p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.TIKTOKEN_ENCODING", "modulename": "microcore.configuration", "qualname": "LLMConfig.TIKTOKEN_ENCODING", "kind": "variable", "doc": "<p>Will enforce using specific encoding for token size measurement</p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.LLM_DEFAULT_ARGS", "modulename": "microcore.configuration", "qualname": "LLMConfig.LLM_DEFAULT_ARGS", "kind": "variable", "doc": "<p>You may specify here default arguments for the LLM API calls,\n i. e. temperature, max_tokens, etc.</p>\n", "annotation": ": dict", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.AZURE_DEPLOYMENT_ID", "modulename": "microcore.configuration", "qualname": "LLMConfig.AZURE_DEPLOYMENT_ID", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.INFERENCE_FUNC", "modulename": "microcore.configuration", "qualname": "LLMConfig.INFERENCE_FUNC", "kind": "variable", "doc": "<p>Inference function for local models</p>\n", "annotation": ": Union[Callable, str]", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.CHAT_MODE", "modulename": "microcore.configuration", "qualname": "LLMConfig.CHAT_MODE", "kind": "variable", "doc": "<p>Is it a chat or completion model</p>\n", "annotation": ": bool", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.INIT_PARAMS", "modulename": "microcore.configuration", "qualname": "LLMConfig.INIT_PARAMS", "kind": "variable", "doc": "<p>Custom initialization parameters for the model</p>\n", "annotation": ": dict", "default_value": "<object object>"}, {"fullname": "microcore.configuration.LLMConfig.uses_local_model", "modulename": "microcore.configuration", "qualname": "LLMConfig.uses_local_model", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">bool</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.configuration.LLMConfig.validate", "modulename": "microcore.configuration", "qualname": "LLMConfig.validate", "kind": "function", "doc": "<p>Validate LLM configuration</p>\n\n<h6 id=\"raises\">Raises:</h6>\n\n<ul>\n<li>LLMConfigError</li>\n</ul>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.configuration.LLMConfig.describe", "modulename": "microcore.configuration", "qualname": "LLMConfig.describe", "kind": "function", "doc": "<p>Informal description of the configuration</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">return_dict</span><span class=\"o\">=</span><span class=\"kc\">False</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.configuration.LLMConfigError", "modulename": "microcore.configuration", "qualname": "LLMConfigError", "kind": "class", "doc": "<p>LLM configuration error</p>\n", "bases": "builtins.ValueError"}, {"fullname": "microcore.configuration.Config", "modulename": "microcore.configuration", "qualname": "Config", "kind": "class", "doc": "<p>MicroCore configuration</p>\n", "bases": "LLMConfig"}, {"fullname": "microcore.configuration.Config.__init__", "modulename": "microcore.configuration", "qualname": "Config.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_ACCESS_TOKEN</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_PROJECT_ID</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_LOCATION</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_GCLOUD_AUTH</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_VERTEX_RESPONSE_VALIDATION</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">GOOGLE_GEMINI_SAFETY_SETTINGS</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">ANTHROPIC_API_KEY</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_TYPE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_KEY</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_BASE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">OPENAI_API_VERSION</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">USE_DOT_ENV</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">DOT_ENV_FILE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_TYPE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_KEY</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_BASE</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_API_VERSION</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_DEPLOYMENT_ID</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">MODEL</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">TIKTOKEN_ENCODING</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">LLM_DEFAULT_ARGS</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">AZURE_DEPLOYMENT_ID</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">INFERENCE_FUNC</span><span class=\"p\">:</span> <span class=\"n\">Union</span><span class=\"p\">[</span><span class=\"n\">Callable</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">CHAT_MODE</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">INIT_PARAMS</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">USE_LOGGING</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">PROMPT_TEMPLATES_PATH</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">STORAGE_PATH</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">STORAGE_DEFAULT_FILE_EXT</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">EMBEDDING_DB_FOLDER</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">EMBEDDING_DB_FUNCTION</span><span class=\"p\">:</span> <span class=\"n\">Any</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">EMBEDDING_DB_ALLOW_DUPLICATES</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">DEFAULT_ENCODING</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">JINJA2_AUTO_ESCAPE</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">ELEVENLABS_API_KEY</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">TEXT_TO_SPEECH_PATH</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">MAX_CONCURRENT_TASKS</span><span class=\"p\">:</span> <span class=\"nb\">int</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span></span>)</span>"}, {"fullname": "microcore.configuration.Config.USE_LOGGING", "modulename": "microcore.configuration", "qualname": "Config.USE_LOGGING", "kind": "variable", "doc": "<p>Whether to use logging or not, see <code>microcore.use_logging</code></p>\n", "annotation": ": bool", "default_value": "<object object>"}, {"fullname": "microcore.configuration.Config.PROMPT_TEMPLATES_PATH", "modulename": "microcore.configuration", "qualname": "Config.PROMPT_TEMPLATES_PATH", "kind": "variable", "doc": "<p>Path to the folder with prompt templates, ./tpl by default</p>\n", "annotation": ": str | pathlib.Path", "default_value": "<object object>"}, {"fullname": "microcore.configuration.Config.STORAGE_PATH", "modulename": "microcore.configuration", "qualname": "Config.STORAGE_PATH", "kind": "variable", "doc": "<p>Path to the folder with file storage, ./storage by default</p>\n", "annotation": ": str | pathlib.Path", "default_value": "<object object>"}, {"fullname": "microcore.configuration.Config.STORAGE_DEFAULT_FILE_EXT", "modulename": "microcore.configuration", "qualname": "Config.STORAGE_DEFAULT_FILE_EXT", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.Config.EMBEDDING_DB_FOLDER", "modulename": "microcore.configuration", "qualname": "Config.EMBEDDING_DB_FOLDER", "kind": "variable", "doc": "<p>Folder within microcore.config.Config.STORAGE_PATH for storing embeddings</p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.Config.EMBEDDING_DB_FUNCTION", "modulename": "microcore.configuration", "qualname": "Config.EMBEDDING_DB_FUNCTION", "kind": "variable", "doc": "<p></p>\n", "annotation": ": Any", "default_value": "<object object>"}, {"fullname": "microcore.configuration.Config.EMBEDDING_DB_ALLOW_DUPLICATES", "modulename": "microcore.configuration", "qualname": "Config.EMBEDDING_DB_ALLOW_DUPLICATES", "kind": "variable", "doc": "<p></p>\n", "annotation": ": bool", "default_value": "<object object>"}, {"fullname": "microcore.configuration.Config.DEFAULT_ENCODING", "modulename": "microcore.configuration", "qualname": "Config.DEFAULT_ENCODING", "kind": "variable", "doc": "<p>Used in file system operations, utf-8 by default</p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.Config.JINJA2_AUTO_ESCAPE", "modulename": "microcore.configuration", "qualname": "Config.JINJA2_AUTO_ESCAPE", "kind": "variable", "doc": "<p></p>\n", "annotation": ": bool", "default_value": "<object object>"}, {"fullname": "microcore.configuration.Config.ELEVENLABS_API_KEY", "modulename": "microcore.configuration", "qualname": "Config.ELEVENLABS_API_KEY", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "<object object>"}, {"fullname": "microcore.configuration.Config.TEXT_TO_SPEECH_PATH", "modulename": "microcore.configuration", "qualname": "Config.TEXT_TO_SPEECH_PATH", "kind": "variable", "doc": "<p>Path to the folder with generated voice files</p>\n", "annotation": ": str | pathlib.Path", "default_value": "<object object>"}, {"fullname": "microcore.configuration.Config.MAX_CONCURRENT_TASKS", "modulename": "microcore.configuration", "qualname": "Config.MAX_CONCURRENT_TASKS", "kind": "variable", "doc": "<p></p>\n", "annotation": ": int", "default_value": "<object object>"}, {"fullname": "microcore.embedding_db", "modulename": "microcore.embedding_db", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.embedding_db.SearchResults", "modulename": "microcore.embedding_db", "qualname": "SearchResults", "kind": "class", "doc": "<p>Built-in mutable sequence.</p>\n\n<p>If no argument is given, the constructor creates a new empty list.\nThe argument must be an iterable if specified.</p>\n", "bases": "builtins.list"}, {"fullname": "microcore.embedding_db.SearchResults.fit_to_token_size", "modulename": "microcore.embedding_db", "qualname": "SearchResults.fit_to_token_size", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">max_tokens</span><span class=\"p\">:</span> <span class=\"nb\">int</span>,</span><span class=\"param\">\t<span class=\"n\">for_model</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">encoding</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">tiktoken</span><span class=\"o\">.</span><span class=\"n\">core</span><span class=\"o\">.</span><span class=\"n\">Encoding</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">verbose</span><span class=\"o\">=</span><span class=\"kc\">True</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.SearchResult", "modulename": "microcore.embedding_db", "qualname": "SearchResult", "kind": "class", "doc": "<p>String containing the search result with additional information in attributes</p>\n\n<h6 id=\"attributes\">Attributes:</h6>\n\n<ul>\n<li><strong>id (str):</strong> document (text) identifier in embedding database</li>\n<li><strong>distance (float):</strong> The distance between the query and the search result</li>\n<li><strong>metadata (dict):</strong> A dictionary containing document metadata</li>\n</ul>\n", "bases": "microcore.utils.ExtendedString"}, {"fullname": "microcore.embedding_db.SearchResult.__init__", "modulename": "microcore.embedding_db", "qualname": "SearchResult.__init__", "kind": "function", "doc": "<p>Allows string to have attributes.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">string</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">attrs</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span>)</span>"}, {"fullname": "microcore.embedding_db.SearchResult.id", "modulename": "microcore.embedding_db", "qualname": "SearchResult.id", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str"}, {"fullname": "microcore.embedding_db.SearchResult.distance", "modulename": "microcore.embedding_db", "qualname": "SearchResult.distance", "kind": "variable", "doc": "<p></p>\n", "annotation": ": float"}, {"fullname": "microcore.embedding_db.SearchResult.metadata", "modulename": "microcore.embedding_db", "qualname": "SearchResult.metadata", "kind": "variable", "doc": "<p></p>\n", "annotation": ": dict"}, {"fullname": "microcore.embedding_db.AbstractEmbeddingDB", "modulename": "microcore.embedding_db", "qualname": "AbstractEmbeddingDB", "kind": "class", "doc": "<p>Base class for embedding databases</p>\n", "bases": "abc.ABC"}, {"fullname": "microcore.embedding_db.AbstractEmbeddingDB.search", "modulename": "microcore.embedding_db", "qualname": "AbstractEmbeddingDB.search", "kind": "function", "doc": "<p>Similarity search</p>\n\n<h6 id=\"arguments\">Arguments:</h6>\n\n<ul>\n<li><strong>collection (str):</strong> collection name</li>\n<li><strong>query (str | list):</strong> query string or list of query strings</li>\n<li><strong>n_results (int):</strong> number of results to return</li>\n<li><strong>where (dict):</strong> filter results by metadata</li>\n<li><strong>**kwargs:</strong> additional arguments</li>\n</ul>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span>,</span><span class=\"param\">\t<span class=\"n\">query</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"nb\">list</span>,</span><span class=\"param\">\t<span class=\"n\">n_results</span><span class=\"p\">:</span> <span class=\"nb\">int</span> <span class=\"o\">=</span> <span class=\"mi\">5</span>,</span><span class=\"param\">\t<span class=\"n\">where</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">embedding_db</span><span class=\"o\">.</span><span class=\"n\">SearchResult</span><span class=\"p\">]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.AbstractEmbeddingDB.find", "modulename": "microcore.embedding_db", "qualname": "AbstractEmbeddingDB.find", "kind": "function", "doc": "<p>Alias for <code>search</code></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"o\">*</span><span class=\"n\">args</span>,</span><span class=\"param\">\t<span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">) -> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">embedding_db</span><span class=\"o\">.</span><span class=\"n\">SearchResults</span> <span class=\"o\">|</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">embedding_db</span><span class=\"o\">.</span><span class=\"n\">SearchResult</span><span class=\"p\">]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.AbstractEmbeddingDB.find_all", "modulename": "microcore.embedding_db", "qualname": "AbstractEmbeddingDB.find_all", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span>,</span><span class=\"param\">\t<span class=\"n\">query</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"nb\">list</span>,</span><span class=\"param\">\t<span class=\"n\">where</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">) -> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">embedding_db</span><span class=\"o\">.</span><span class=\"n\">SearchResults</span> <span class=\"o\">|</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">embedding_db</span><span class=\"o\">.</span><span class=\"n\">SearchResult</span><span class=\"p\">]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.AbstractEmbeddingDB.get_all", "modulename": "microcore.embedding_db", "qualname": "AbstractEmbeddingDB.get_all", "kind": "function", "doc": "<p>Return all documents in the collection</p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">) -> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">embedding_db</span><span class=\"o\">.</span><span class=\"n\">SearchResults</span> <span class=\"o\">|</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">embedding_db</span><span class=\"o\">.</span><span class=\"n\">SearchResult</span><span class=\"p\">]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.AbstractEmbeddingDB.save", "modulename": "microcore.embedding_db", "qualname": "AbstractEmbeddingDB.save", "kind": "function", "doc": "<p>Save a single document in the collection</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">text</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">metadata</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.AbstractEmbeddingDB.save_many", "modulename": "microcore.embedding_db", "qualname": "AbstractEmbeddingDB.save_many", "kind": "function", "doc": "<p>Save multiple documents in the collection</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">items</span><span class=\"p\">:</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">tuple</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"nb\">dict</span><span class=\"p\">]</span> <span class=\"o\">|</span> <span class=\"nb\">str</span><span class=\"p\">]</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.AbstractEmbeddingDB.clear", "modulename": "microcore.embedding_db", "qualname": "AbstractEmbeddingDB.clear", "kind": "function", "doc": "<p>Clear the collection</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.AbstractEmbeddingDB.find_one", "modulename": "microcore.embedding_db", "qualname": "AbstractEmbeddingDB.find_one", "kind": "function", "doc": "<p>Find most similar document in the collection</p>\n\n<h6 id=\"returns\">Returns:</h6>\n\n<blockquote>\n <p>Most similar document or None if collection is empty</p>\n</blockquote>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span>,</span><span class=\"param\">\t<span class=\"n\">query</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"nb\">list</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">embedding_db</span><span class=\"o\">.</span><span class=\"n\">SearchResult</span> <span class=\"o\">|</span> <span class=\"kc\">None</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.AbstractEmbeddingDB.count", "modulename": "microcore.embedding_db", "qualname": "AbstractEmbeddingDB.count", "kind": "function", "doc": "<p>Count the number of documents in the collection</p>\n\n<h6 id=\"returns\">Returns:</h6>\n\n<blockquote>\n <p>Number of documents in the collection</p>\n</blockquote>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">int</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.AbstractEmbeddingDB.delete", "modulename": "microcore.embedding_db", "qualname": "AbstractEmbeddingDB.delete", "kind": "function", "doc": "<p>Delete documents from the collection</p>\n\n<h6 id=\"arguments\">Arguments:</h6>\n\n<ul>\n<li><strong>collection (str):</strong> collection name</li>\n<li><strong>what (str | list[str] | dict):</strong> id, list ids or metadata query</li>\n</ul>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">what</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]</span> <span class=\"o\">|</span> <span class=\"nb\">dict</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.chromadb", "modulename": "microcore.embedding_db.chromadb", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.embedding_db.chromadb.ChromaEmbeddingDB", "modulename": "microcore.embedding_db.chromadb", "qualname": "ChromaEmbeddingDB", "kind": "class", "doc": "<p></p>\n", "bases": "microcore.embedding_db.AbstractEmbeddingDB"}, {"fullname": "microcore.embedding_db.chromadb.ChromaEmbeddingDB.__init__", "modulename": "microcore.embedding_db.chromadb", "qualname": "ChromaEmbeddingDB.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span>,</span><span class=\"param\">\t<span class=\"n\">embedding_function</span><span class=\"p\">:</span> <span class=\"n\">chromadb</span><span class=\"o\">.</span><span class=\"n\">api</span><span class=\"o\">.</span><span class=\"n\">types</span><span class=\"o\">.</span><span class=\"n\">EmbeddingFunction</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">client</span><span class=\"p\">:</span> <span class=\"o\"><</span><span class=\"n\">function</span> <span class=\"n\">Client</span><span class=\"o\">></span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span>)</span>"}, {"fullname": "microcore.embedding_db.chromadb.ChromaEmbeddingDB.config", "modulename": "microcore.embedding_db.chromadb", "qualname": "ChromaEmbeddingDB.config", "kind": "variable", "doc": "<p></p>\n", "annotation": ": microcore.configuration.Config"}, {"fullname": "microcore.embedding_db.chromadb.ChromaEmbeddingDB.embedding_function", "modulename": "microcore.embedding_db.chromadb", "qualname": "ChromaEmbeddingDB.embedding_function", "kind": "variable", "doc": "<p></p>\n", "annotation": ": chromadb.api.types.EmbeddingFunction", "default_value": "None"}, {"fullname": "microcore.embedding_db.chromadb.ChromaEmbeddingDB.client", "modulename": "microcore.embedding_db.chromadb", "qualname": "ChromaEmbeddingDB.client", "kind": "variable", "doc": "<p></p>\n", "annotation": ": <function Client at 0x7fb3982ed260>", "default_value": "None"}, {"fullname": "microcore.embedding_db.chromadb.ChromaEmbeddingDB.search", "modulename": "microcore.embedding_db.chromadb", "qualname": "ChromaEmbeddingDB.search", "kind": "function", "doc": "<p>Similarity search</p>\n\n<h6 id=\"arguments\">Arguments:</h6>\n\n<ul>\n<li><strong>collection (str):</strong> collection name</li>\n<li><strong>query (str | list):</strong> query string or list of query strings</li>\n<li><strong>n_results (int):</strong> number of results to return</li>\n<li><strong>where (dict):</strong> filter results by metadata</li>\n<li><strong>**kwargs:</strong> additional arguments</li>\n</ul>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span>,</span><span class=\"param\">\t<span class=\"n\">query</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"nb\">list</span>,</span><span class=\"param\">\t<span class=\"n\">n_results</span><span class=\"p\">:</span> <span class=\"nb\">int</span> <span class=\"o\">=</span> <span class=\"mi\">5</span>,</span><span class=\"param\">\t<span class=\"n\">where</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">embedding_db</span><span class=\"o\">.</span><span class=\"n\">SearchResult</span><span class=\"p\">]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.chromadb.ChromaEmbeddingDB.save_many", "modulename": "microcore.embedding_db.chromadb", "qualname": "ChromaEmbeddingDB.save_many", "kind": "function", "doc": "<p>Save multiple documents in the collection</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">items</span><span class=\"p\">:</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">tuple</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"nb\">dict</span><span class=\"p\">]</span> <span class=\"o\">|</span> <span class=\"nb\">str</span><span class=\"p\">]</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.chromadb.ChromaEmbeddingDB.clear", "modulename": "microcore.embedding_db.chromadb", "qualname": "ChromaEmbeddingDB.clear", "kind": "function", "doc": "<p>Clear the collection</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.chromadb.ChromaEmbeddingDB.count", "modulename": "microcore.embedding_db.chromadb", "qualname": "ChromaEmbeddingDB.count", "kind": "function", "doc": "<p>Count the number of documents in the collection</p>\n\n<h6 id=\"returns\">Returns:</h6>\n\n<blockquote>\n <p>Number of documents in the collection</p>\n</blockquote>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">int</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.chromadb.ChromaEmbeddingDB.delete", "modulename": "microcore.embedding_db.chromadb", "qualname": "ChromaEmbeddingDB.delete", "kind": "function", "doc": "<p>Delete documents from the collection</p>\n\n<h6 id=\"arguments\">Arguments:</h6>\n\n<ul>\n<li><strong>collection (str):</strong> collection name</li>\n<li><strong>what (str | list[str] | dict):</strong> id, list ids or metadata query</li>\n</ul>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">what</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]</span> <span class=\"o\">|</span> <span class=\"nb\">dict</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.embedding_db.chromadb.ChromaEmbeddingDB.get_all", "modulename": "microcore.embedding_db.chromadb", "qualname": "ChromaEmbeddingDB.get_all", "kind": "function", "doc": "<p>Return all documents in the collection</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">collection</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">embedding_db</span><span class=\"o\">.</span><span class=\"n\">SearchResult</span><span class=\"p\">]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage", "modulename": "microcore.file_storage", "kind": "module", "doc": "<p>File storage functions</p>\n"}, {"fullname": "microcore.file_storage.Storage", "modulename": "microcore.file_storage", "qualname": "Storage", "kind": "class", "doc": "<p></p>\n"}, {"fullname": "microcore.file_storage.Storage.path", "modulename": "microcore.file_storage", "qualname": "Storage.path", "kind": "variable", "doc": "<p></p>\n", "annotation": ": pathlib.Path"}, {"fullname": "microcore.file_storage.Storage.default_ext", "modulename": "microcore.file_storage", "qualname": "Storage.default_ext", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str | None"}, {"fullname": "microcore.file_storage.Storage.file_link", "modulename": "microcore.file_storage", "qualname": "Storage.file_link", "kind": "function", "doc": "<p>Returns file name in format displayed in PyCharm console as a link.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">file_name</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">str</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage.Storage.default_encoding", "modulename": "microcore.file_storage", "qualname": "Storage.default_encoding", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str"}, {"fullname": "microcore.file_storage.Storage.exists", "modulename": "microcore.file_storage", "qualname": "Storage.exists", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">name</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">bool</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage.Storage.abs_path", "modulename": "microcore.file_storage", "qualname": "Storage.abs_path", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">name</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span></span><span class=\"return-annotation\">) -> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage.Storage.read", "modulename": "microcore.file_storage", "qualname": "Storage.read", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">name</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span>, </span><span class=\"param\"><span class=\"n\">encoding</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage.Storage.write_json", "modulename": "microcore.file_storage", "qualname": "Storage.write_json", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">name</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span>,</span><span class=\"param\">\t<span class=\"n\">data</span>,</span><span class=\"param\">\t<span class=\"n\">rewrite_existing</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>,</span><span class=\"param\">\t<span class=\"n\">backup_existing</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>,</span><span class=\"param\">\t<span class=\"n\">ensure_ascii</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">False</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage.Storage.read_json", "modulename": "microcore.file_storage", "qualname": "Storage.read_json", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">name</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span>, </span><span class=\"param\"><span class=\"n\">default</span><span class=\"o\">=</span><span class=\"kc\">None</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage.Storage.delete", "modulename": "microcore.file_storage", "qualname": "Storage.delete", "kind": "function", "doc": "<p>Removes the file or directory specified by <code>path</code> within the <code>storage_path</code> if exists.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">target</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">|</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span><span class=\"p\">]</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage.Storage.write", "modulename": "microcore.file_storage", "qualname": "Storage.write", "kind": "function", "doc": "<h6 id=\"returns\">Returns</h6>\n\n<blockquote>\n <p>str File name for further usage</p>\n</blockquote>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">name</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span>,</span><span class=\"param\">\t<span class=\"n\">content</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"o\"><</span><span class=\"nb\">object</span> <span class=\"nb\">object</span><span class=\"o\">></span>,</span><span class=\"param\">\t<span class=\"n\">rewrite_existing</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">backup_existing</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">encoding</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">append</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">False</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">PathLike</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage.Storage.clean", "modulename": "microcore.file_storage", "qualname": "Storage.clean", "kind": "function", "doc": "<p>Removes the directory specified by <code>path</code> within the <code>storage_path</code>.</p>\n\n<h6 id=\"raises\">Raises</h6>\n\n<ul>\n<li><strong>ValueError</strong>: If the path is outside the storage area.\n@deprecated use storage.delete() instead</li>\n</ul>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span>, </span><span class=\"param\"><span class=\"n\">path</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage.Storage.list_files", "modulename": "microcore.file_storage", "qualname": "Storage.list_files", "kind": "function", "doc": "<p>Lists files in a specified directory, excluding those that match given patterns.</p>\n\n<h6 id=\"arguments\">Arguments:</h6>\n\n<ul>\n<li><strong>target_dir (str | Path):</strong> The directory to search in.</li>\n<li><strong>exclude (list[str | Path], optional):</strong> Patterns of files to exclude.</li>\n<li><strong>relative_to (str | Path, optional):</strong> Base directory for relative paths.\nIf None, paths are relative to <code>target_dir</code>. Defaults to None.</li>\n<li><strong>absolute (bool, optional):</strong> If True, returns absolute paths. Defaults to False.</li>\n<li><strong>posix (bool, optional):</strong> If True, returns posix paths. Defaults to False.</li>\n</ul>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">target_dir</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"s1\">''</span>,</span><span class=\"param\">\t<span class=\"n\">exclude</span><span class=\"p\">:</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">relative_to</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">absolute</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>,</span><span class=\"param\">\t<span class=\"n\">posix</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">False</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">|</span> <span class=\"nb\">str</span><span class=\"p\">]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage.Storage.copy", "modulename": "microcore.file_storage", "qualname": "Storage.copy", "kind": "function", "doc": "<p>Copy a file or folder from src to dest, overwriting content,\nbut skipping paths in exceptions.\nSupports Unix shell-style wildcards in exceptions. Accepts Path objects.</p>\n\n<h6 id=\"arguments\">Arguments:</h6>\n\n<ul>\n<li><strong>src (Path):</strong> Source file or directory Path object.</li>\n<li><strong>dest (Path):</strong> Destination file or directory Path object.</li>\n<li><strong>exclude (list of str, optional):</strong> List of Unix shell-style wildcard patterns relative to src.\nThese paths will be excluded from the copy. Defaults to None.</li>\n</ul>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">src</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span>,</span><span class=\"param\">\t<span class=\"n\">dest</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span>,</span><span class=\"param\">\t<span class=\"n\">exclude</span><span class=\"o\">=</span><span class=\"kc\">None</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.file_storage.storage", "modulename": "microcore.file_storage", "qualname": "storage", "kind": "variable", "doc": "<p>File system operations within the storage folder.</p>\n\n<p>See <code>Storage</code> for details.</p>\n\n<h6 id=\"related-configuration-options\">Related configuration options:</h6>\n\n<blockquote>\n <ul>\n <li><code>microcore.config.Config.STORAGE_PATH</code></li>\n <li><code>microcore.config.Config.DEFAULT_ENCODING</code></li>\n </ul>\n</blockquote>\n", "default_value": "<microcore.file_storage.Storage object>"}, {"fullname": "microcore.llm.anthropic", "modulename": "microcore.llm.anthropic", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.llm.anthropic.make_llm_functions", "modulename": "microcore.llm.anthropic", "qualname": "make_llm_functions", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">tuple</span><span class=\"p\">[</span><span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"nb\">str</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Awaitable</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]]]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.google_genai", "modulename": "microcore.llm.google_genai", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.llm.google_genai.make_llm_functions", "modulename": "microcore.llm.google_genai", "qualname": "make_llm_functions", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">tuple</span><span class=\"p\">[</span><span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"nb\">str</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Awaitable</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]]]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.google_vertex_ai", "modulename": "microcore.llm.google_vertex_ai", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.llm.google_vertex_ai.init_vertex_ai", "modulename": "microcore.llm.google_vertex_ai", "qualname": "init_vertex_ai", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.google_vertex_ai.make_llm_functions", "modulename": "microcore.llm.google_vertex_ai", "qualname": "make_llm_functions", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">tuple</span><span class=\"p\">[</span><span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"nb\">str</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Awaitable</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]]]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.local_llm", "modulename": "microcore.llm.local_llm", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.llm.local_llm.make_llm_functions", "modulename": "microcore.llm.local_llm", "qualname": "make_llm_functions", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span>,</span><span class=\"param\">\t<span class=\"n\">overriden_inference_func</span><span class=\"p\">:</span> <span class=\"o\"><</span><span class=\"n\">built</span><span class=\"o\">-</span><span class=\"ow\">in</span> <span class=\"n\">function</span> <span class=\"nb\">callable</span><span class=\"o\">></span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">tuple</span><span class=\"p\">[</span><span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"nb\">str</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Awaitable</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]]]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.local_transformers", "modulename": "microcore.llm.local_transformers", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.llm.local_transformers.inference", "modulename": "microcore.llm.local_transformers", "qualname": "inference", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">prompt</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">model</span>, </span><span class=\"param\"><span class=\"n\">tokenizer</span>, </span><span class=\"param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.local_transformers.pipeline_inference", "modulename": "microcore.llm.local_transformers", "qualname": "pipeline_inference", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">prompt</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">pipeline</span>, </span><span class=\"param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.local_transformers.clear_mem", "modulename": "microcore.llm.local_transformers", "qualname": "clear_mem", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.local_transformers.try_make_model_config", "modulename": "microcore.llm.local_transformers", "qualname": "try_make_model_config", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.local_transformers.get_last_message_ending", "modulename": "microcore.llm.local_transformers", "qualname": "get_last_message_ending", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">tokenizer</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">str</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.local_transformers.resolve_tokenizer", "modulename": "microcore.llm.local_transformers", "qualname": "resolve_tokenizer", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.local_transformers.resolve_model", "modulename": "microcore.llm.local_transformers", "qualname": "resolve_model", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.local_transformers.make_llm_functions", "modulename": "microcore.llm.local_transformers", "qualname": "make_llm_functions", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span>,</span><span class=\"param\">\t<span class=\"n\">env</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">tuple</span><span class=\"p\">[</span><span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"nb\">str</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Awaitable</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]]]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.llm.openai_llm", "modulename": "microcore.llm.openai_llm", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.llm.openai_llm.make_llm_functions", "modulename": "microcore.llm.openai_llm", "qualname": "make_llm_functions", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">tuple</span><span class=\"p\">[</span><span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"nb\">str</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Callable</span><span class=\"p\">[[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span><span class=\"p\">],</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Awaitable</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">]]]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.message_types", "modulename": "microcore.message_types", "kind": "module", "doc": "<p>Message classes for OpenAI Chat API</p>\n"}, {"fullname": "microcore.message_types.Role", "modulename": "microcore.message_types", "qualname": "Role", "kind": "class", "doc": "<p></p>\n"}, {"fullname": "microcore.message_types.Role.SYSTEM", "modulename": "microcore.message_types", "qualname": "Role.SYSTEM", "kind": "variable", "doc": "<p></p>\n", "default_value": "'system'"}, {"fullname": "microcore.message_types.Role.USER", "modulename": "microcore.message_types", "qualname": "Role.USER", "kind": "variable", "doc": "<p></p>\n", "default_value": "'user'"}, {"fullname": "microcore.message_types.Role.ASSISTANT", "modulename": "microcore.message_types", "qualname": "Role.ASSISTANT", "kind": "variable", "doc": "<p></p>\n", "default_value": "'assistant'"}, {"fullname": "microcore.message_types.DEFAULT_MESSAGE_ROLE", "modulename": "microcore.message_types", "qualname": "DEFAULT_MESSAGE_ROLE", "kind": "variable", "doc": "<p></p>\n", "default_value": "'user'"}, {"fullname": "microcore.message_types.Msg", "modulename": "microcore.message_types", "qualname": "Msg", "kind": "class", "doc": "<p></p>\n"}, {"fullname": "microcore.message_types.Msg.__init__", "modulename": "microcore.message_types", "qualname": "Msg.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">role</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">'user'</span>, </span><span class=\"param\"><span class=\"n\">content</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">''</span></span>)</span>"}, {"fullname": "microcore.message_types.Msg.dict_factory", "modulename": "microcore.message_types", "qualname": "Msg.dict_factory", "kind": "variable", "doc": "<p></p>\n", "default_value": "<class 'dict'>"}, {"fullname": "microcore.message_types.Msg.role", "modulename": "microcore.message_types", "qualname": "Msg.role", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "'user'"}, {"fullname": "microcore.message_types.Msg.content", "modulename": "microcore.message_types", "qualname": "Msg.content", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "''"}, {"fullname": "microcore.message_types.Msg.strip", "modulename": "microcore.message_types", "qualname": "Msg.strip", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.message_types.SysMsg", "modulename": "microcore.message_types", "qualname": "SysMsg", "kind": "class", "doc": "<p></p>\n", "bases": "Msg"}, {"fullname": "microcore.message_types.SysMsg.__init__", "modulename": "microcore.message_types", "qualname": "SysMsg.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">content</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">''</span></span>)</span>"}, {"fullname": "microcore.message_types.SysMsg.role", "modulename": "microcore.message_types", "qualname": "SysMsg.role", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "'system'"}, {"fullname": "microcore.message_types.UserMsg", "modulename": "microcore.message_types", "qualname": "UserMsg", "kind": "class", "doc": "<p></p>\n", "bases": "Msg"}, {"fullname": "microcore.message_types.UserMsg.__init__", "modulename": "microcore.message_types", "qualname": "UserMsg.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">content</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">''</span></span>)</span>"}, {"fullname": "microcore.message_types.UserMsg.role", "modulename": "microcore.message_types", "qualname": "UserMsg.role", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "'user'"}, {"fullname": "microcore.message_types.AssistantMsg", "modulename": "microcore.message_types", "qualname": "AssistantMsg", "kind": "class", "doc": "<p></p>\n", "bases": "Msg"}, {"fullname": "microcore.message_types.AssistantMsg.__init__", "modulename": "microcore.message_types", "qualname": "AssistantMsg.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">content</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">''</span></span>)</span>"}, {"fullname": "microcore.message_types.AssistantMsg.role", "modulename": "microcore.message_types", "qualname": "AssistantMsg.role", "kind": "variable", "doc": "<p></p>\n", "annotation": ": str", "default_value": "'assistant'"}, {"fullname": "microcore.message_types.PartialMsg", "modulename": "microcore.message_types", "qualname": "PartialMsg", "kind": "class", "doc": "<p>A message that is not fully formed yet.</p>\n", "bases": "AssistantMsg"}, {"fullname": "microcore.message_types.PartialMsg.dict_factory", "modulename": "microcore.message_types", "qualname": "PartialMsg.dict_factory", "kind": "variable", "doc": "<p></p>\n", "default_value": "<class 'microcore.message_types.PartialMsg._PartialMsgDict'>"}, {"fullname": "microcore.message_types.PartialMsg.placeholder", "modulename": "microcore.message_types", "qualname": "PartialMsg.placeholder", "kind": "variable", "doc": "<p></p>\n", "default_value": "'<|placeholder|>'"}, {"fullname": "microcore.message_types.PartialMsg.variants_splitter", "modulename": "microcore.message_types", "qualname": "PartialMsg.variants_splitter", "kind": "variable", "doc": "<p></p>\n", "default_value": "'<|or|>'"}, {"fullname": "microcore.message_types.PartialMsg.split_prefix_and_suffixes", "modulename": "microcore.message_types", "qualname": "PartialMsg.split_prefix_and_suffixes", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">content</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.message_types.PartialMsg.prefix_and_suffixes", "modulename": "microcore.message_types", "qualname": "PartialMsg.prefix_and_suffixes", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.message_types.PartialMsg.prefix", "modulename": "microcore.message_types", "qualname": "PartialMsg.prefix", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.message_types.PartialMsg.suffixes", "modulename": "microcore.message_types", "qualname": "PartialMsg.suffixes", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"bp\">self</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.types", "modulename": "microcore.types", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.types.TplFunctionType", "modulename": "microcore.types", "qualname": "TplFunctionType", "kind": "variable", "doc": "<p>Function type for rendering prompt templates</p>\n", "default_value": "typing.Callable[[typing.Union[os.PathLike[str], str], typing.Any], str]"}, {"fullname": "microcore.types.LLMFunctionType", "modulename": "microcore.types", "qualname": "LLMFunctionType", "kind": "variable", "doc": "<p>Function type for requesting LLM synchronously</p>\n", "default_value": "typing.Callable[[str, typing.Any], str]"}, {"fullname": "microcore.types.LLMAsyncFunctionType", "modulename": "microcore.types", "qualname": "LLMAsyncFunctionType", "kind": "variable", "doc": "<p>Function type for requesting LLM asynchronously</p>\n", "default_value": "typing.Callable[[str, typing.Any], typing.Awaitable[str]]"}, {"fullname": "microcore.types.BadAIAnswer", "modulename": "microcore.types", "qualname": "BadAIAnswer", "kind": "class", "doc": "<p>Unprocessable response generated by the LLM</p>\n", "bases": "builtins.ValueError"}, {"fullname": "microcore.types.BadAIAnswer.__init__", "modulename": "microcore.types", "qualname": "BadAIAnswer.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">message</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>, </span><span class=\"param\"><span class=\"n\">details</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span>)</span>"}, {"fullname": "microcore.types.BadAIAnswer.message", "modulename": "microcore.types", "qualname": "BadAIAnswer.message", "kind": "variable", "doc": "<p></p>\n"}, {"fullname": "microcore.types.BadAIAnswer.details", "modulename": "microcore.types", "qualname": "BadAIAnswer.details", "kind": "variable", "doc": "<p></p>\n"}, {"fullname": "microcore.types.BadAIJsonAnswer", "modulename": "microcore.types", "qualname": "BadAIJsonAnswer", "kind": "class", "doc": "<p>Unprocessable response generated by the LLM</p>\n", "bases": "BadAIAnswer"}, {"fullname": "microcore.types.BadAIJsonAnswer.__init__", "modulename": "microcore.types", "qualname": "BadAIJsonAnswer.__init__", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">message</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">'Invalid JSON generated by the LLM'</span>, </span><span class=\"param\"><span class=\"n\">details</span><span class=\"o\">=</span><span class=\"kc\">None</span></span>)</span>"}, {"fullname": "microcore.ui", "modulename": "microcore.ui", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.ui.info", "modulename": "microcore.ui", "qualname": "info", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"o\">*</span><span class=\"n\">args</span>, </span><span class=\"param\"><span class=\"n\">color</span><span class=\"o\">=</span><span class=\"s1\">'</span><span class=\"se\">\\x1b</span><span class=\"s1\">[93m'</span>, </span><span class=\"param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.debug", "modulename": "microcore.ui", "qualname": "debug", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.error", "modulename": "microcore.ui", "qualname": "error", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"o\">*</span><span class=\"n\">args</span>, </span><span class=\"param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.ask_yn", "modulename": "microcore.ui", "qualname": "ask_yn", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.ask_choose", "modulename": "microcore.ui", "qualname": "ask_choose", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span>, </span><span class=\"param\"><span class=\"n\">variants</span><span class=\"p\">:</span> <span class=\"nb\">list</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.magenta", "modulename": "microcore.ui", "qualname": "magenta", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.yellow", "modulename": "microcore.ui", "qualname": "yellow", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.red", "modulename": "microcore.ui", "qualname": "red", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.blue", "modulename": "microcore.ui", "qualname": "blue", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.green", "modulename": "microcore.ui", "qualname": "green", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.cyan", "modulename": "microcore.ui", "qualname": "cyan", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.white", "modulename": "microcore.ui", "qualname": "white", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.gray", "modulename": "microcore.ui", "qualname": "gray", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.ui.black", "modulename": "microcore.ui", "qualname": "black", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">msg</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils", "modulename": "microcore.utils", "kind": "module", "doc": "<p></p>\n"}, {"fullname": "microcore.utils.is_chat_model", "modulename": "microcore.utils", "qualname": "is_chat_model", "kind": "function", "doc": "<p>Detects if model is chat model or text completion model</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">model</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">config</span><span class=\"p\">:</span> <span class=\"n\">microcore</span><span class=\"o\">.</span><span class=\"n\">configuration</span><span class=\"o\">.</span><span class=\"n\">Config</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">bool</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.ConvertableToMessage", "modulename": "microcore.utils", "qualname": "ConvertableToMessage", "kind": "class", "doc": "<p></p>\n"}, {"fullname": "microcore.utils.ConvertableToMessage.as_user", "modulename": "microcore.utils", "qualname": "ConvertableToMessage.as_user", "kind": "variable", "doc": "<p></p>\n", "annotation": ": microcore.message_types.UserMsg"}, {"fullname": "microcore.utils.ConvertableToMessage.as_system", "modulename": "microcore.utils", "qualname": "ConvertableToMessage.as_system", "kind": "variable", "doc": "<p></p>\n", "annotation": ": microcore.message_types.SysMsg"}, {"fullname": "microcore.utils.ConvertableToMessage.as_assistant", "modulename": "microcore.utils", "qualname": "ConvertableToMessage.as_assistant", "kind": "variable", "doc": "<p></p>\n", "annotation": ": microcore.message_types.AssistantMsg"}, {"fullname": "microcore.utils.ConvertableToMessage.as_model", "modulename": "microcore.utils", "qualname": "ConvertableToMessage.as_model", "kind": "variable", "doc": "<p></p>\n", "annotation": ": microcore.message_types.AssistantMsg"}, {"fullname": "microcore.utils.ExtendedString", "modulename": "microcore.utils", "qualname": "ExtendedString", "kind": "class", "doc": "<p>Provides a way of extending string with attributes and methods</p>\n", "bases": "builtins.str"}, {"fullname": "microcore.utils.ExtendedString.__init__", "modulename": "microcore.utils", "qualname": "ExtendedString.__init__", "kind": "function", "doc": "<p>Allows string to have attributes.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">string</span><span class=\"p\">:</span> <span class=\"nb\">str</span>, </span><span class=\"param\"><span class=\"n\">attrs</span><span class=\"p\">:</span> <span class=\"nb\">dict</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span>)</span>"}, {"fullname": "microcore.utils.ExtendedString.to_tokens", "modulename": "microcore.utils", "qualname": "ExtendedString.to_tokens", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">for_model</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">encoding</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">tiktoken</span><span class=\"o\">.</span><span class=\"n\">core</span><span class=\"o\">.</span><span class=\"n\">Encoding</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.ExtendedString.num_tokens", "modulename": "microcore.utils", "qualname": "ExtendedString.num_tokens", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"bp\">self</span>,</span><span class=\"param\">\t<span class=\"n\">for_model</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">encoding</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">tiktoken</span><span class=\"o\">.</span><span class=\"n\">core</span><span class=\"o\">.</span><span class=\"n\">Encoding</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.parse", "modulename": "microcore.utils", "qualname": "parse", "kind": "function", "doc": "<p>Parse a document divided into sections and convert it into a dictionary.</p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">text</span><span class=\"p\">:</span> <span class=\"nb\">str</span>,</span><span class=\"param\">\t<span class=\"n\">field_format</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">=</span> <span class=\"s1\">'</span><span class=\"se\">\\\\</span><span class=\"s1\">[</span><span class=\"se\">\\\\</span><span class=\"s1\">[(.*?)</span><span class=\"se\">\\\\</span><span class=\"s1\">]</span><span class=\"se\">\\\\</span><span class=\"s1\">]'</span>,</span><span class=\"param\">\t<span class=\"n\">required_fields</span><span class=\"p\">:</span> <span class=\"nb\">list</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">dict</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.file_link", "modulename": "microcore.utils", "qualname": "file_link", "kind": "function", "doc": "<p>Returns file name in format displayed in PyCharm console as a link.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">file_path</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.list_files", "modulename": "microcore.utils", "qualname": "list_files", "kind": "function", "doc": "<p>Lists files in a specified directory, excluding those that match given patterns.</p>\n\n<p>This function traverses the specified directory recursively and returns a list of all files\nthat do not match the specified exclusion patterns. It can return absolute paths,\npaths relative to the target directory, or paths relative to a specified directory.</p>\n\n<h6 id=\"arguments\">Arguments:</h6>\n\n<ul>\n<li><strong>target_dir (str | Path):</strong> The directory to search in.</li>\n<li><strong>exclude (list[str | Path]):</strong> Patterns of files to exclude.</li>\n<li><strong>relative_to (str | Path, optional):</strong> Base directory for relative paths.\nIf None, paths are relative to <code>target_dir</code>. Defaults to None.</li>\n<li><strong>absolute (bool, optional):</strong> If True, returns absolute paths. Defaults to False.</li>\n<li><strong>posix (bool, optional):</strong> If True, returns posix paths. Defaults to False.</li>\n</ul>\n\n<h6 id=\"returns\">Returns:</h6>\n\n<blockquote>\n <p>list[Path]: A list of Path objects representing the files found.</p>\n</blockquote>\n\n<h6 id=\"example\">Example:</h6>\n\n<blockquote>\n <p>exclude_patterns = ['*.pyc', '__pycache__/*']\n target_directory = '/path/to/target'\n files = list_files(target_directory, exclude_patterns)</p>\n</blockquote>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">target_dir</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"s1\">''</span>,</span><span class=\"param\">\t<span class=\"n\">exclude</span><span class=\"p\">:</span> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">relative_to</span><span class=\"p\">:</span> <span class=\"nb\">str</span> <span class=\"o\">|</span> <span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">absolute</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>,</span><span class=\"param\">\t<span class=\"n\">posix</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">False</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">list</span><span class=\"p\">[</span><span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span><span class=\"p\">]</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.is_kaggle", "modulename": "microcore.utils", "qualname": "is_kaggle", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"return-annotation\">) -> <span class=\"nb\">bool</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.is_notebook", "modulename": "microcore.utils", "qualname": "is_notebook", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"return-annotation\">) -> <span class=\"nb\">bool</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.is_google_colab", "modulename": "microcore.utils", "qualname": "is_google_colab", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"return-annotation\">) -> <span class=\"nb\">bool</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.get_vram_usage", "modulename": "microcore.utils", "qualname": "get_vram_usage", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">as_string</span><span class=\"o\">=</span><span class=\"kc\">True</span>, </span><span class=\"param\"><span class=\"n\">color</span><span class=\"o\">=</span><span class=\"s1\">'</span><span class=\"se\">\\x1b</span><span class=\"s1\">[32m'</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.show_vram_usage", "modulename": "microcore.utils", "qualname": "show_vram_usage", "kind": "function", "doc": "<p>Prints GPU VRAM usage.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.return_default", "modulename": "microcore.utils", "qualname": "return_default", "kind": "function", "doc": "<p></p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">default</span>, </span><span class=\"param\"><span class=\"o\">*</span><span class=\"n\">args</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.extract_number", "modulename": "microcore.utils", "qualname": "extract_number", "kind": "function", "doc": "<p>Extract a number from a string.</p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">text</span><span class=\"p\">:</span> <span class=\"nb\">str</span>,</span><span class=\"param\">\t<span class=\"n\">default</span><span class=\"o\">=</span><span class=\"kc\">None</span>,</span><span class=\"param\">\t<span class=\"n\">position</span><span class=\"o\">=</span><span class=\"s1\">'last'</span>,</span><span class=\"param\">\tdtype: type | str = <class 'float'>,</span><span class=\"param\">\t<span class=\"n\">rounding</span><span class=\"p\">:</span> <span class=\"nb\">bool</span> <span class=\"o\">=</span> <span class=\"kc\">False</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">int</span> <span class=\"o\">|</span> <span class=\"nb\">float</span> <span class=\"o\">|</span> <span class=\"n\">typing</span><span class=\"o\">.</span><span class=\"n\">Any</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.dedent", "modulename": "microcore.utils", "qualname": "dedent", "kind": "function", "doc": "<p>Removes minimal shared leading whitespace from each line\nand strips leading and trailing empty lines.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">text</span><span class=\"p\">:</span> <span class=\"nb\">str</span></span><span class=\"return-annotation\">) -> <span class=\"nb\">str</span>:</span></span>", "funcdef": "def"}, {"fullname": "microcore.utils.run_parallel", "modulename": "microcore.utils", "qualname": "run_parallel", "kind": "function", "doc": "<p>Run tasks in parallel with a limit on the number of concurrent tasks.</p>\n", "signature": "<span class=\"signature pdoc-code condensed\">(<span class=\"param\"><span class=\"n\">tasks</span><span class=\"p\">:</span> <span class=\"nb\">list</span>, </span><span class=\"param\"><span class=\"n\">max_concurrent_tasks</span><span class=\"p\">:</span> <span class=\"nb\">int</span></span><span class=\"return-annotation\">):</span></span>", "funcdef": "async def"}, {"fullname": "microcore.utils.resolve_callable", "modulename": "microcore.utils", "qualname": "resolve_callable", "kind": "function", "doc": "<p>Resolves a callable function from a string (module.function)</p>\n", "signature": "<span class=\"signature pdoc-code multiline\">(<span class=\"param\">\t<span class=\"n\">fn</span><span class=\"p\">:</span> <span class=\"n\">Union</span><span class=\"p\">[</span><span class=\"n\">Callable</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">NoneType</span><span class=\"p\">]</span>,</span><span class=\"param\">\t<span class=\"n\">allow_empty</span><span class=\"o\">=</span><span class=\"kc\">False</span></span><span class=\"return-annotation\">) -> <span class=\"n\">Optional</span><span class=\"p\">[</span><span class=\"n\">Callable</span><span class=\"p\">]</span>:</span></span>", "funcdef": "def"}];
// mirrored in build-search-index.js (part 1)
// Also split on html tags. this is a cheap heuristic, but good enough.
elasticlunr.tokenizer.setSeperator(/[\s\-.;&_'"=,()]+|<[^>]*>/);
let searchIndex;
if (docs._isPrebuiltIndex) {
console.info("using precompiled search index");
searchIndex = elasticlunr.Index.load(docs);
} else {
console.time("building search index");
// mirrored in build-search-index.js (part 2)
searchIndex = elasticlunr(function () {
this.pipeline.remove(elasticlunr.stemmer);
this.pipeline.remove(elasticlunr.stopWordFilter);
this.addField("qualname");
this.addField("fullname");
this.addField("annotation");
this.addField("default_value");
this.addField("signature");
this.addField("bases");
this.addField("doc");
this.setRef("fullname");
});
for (let doc of docs) {
searchIndex.addDoc(doc);
}
console.timeEnd("building search index");
}
return (term) => searchIndex.search(term, {
fields: {
qualname: {boost: 4},
fullname: {boost: 2},
annotation: {boost: 2},
default_value: {boost: 2},
signature: {boost: 2},
bases: {boost: 2},
doc: {boost: 1},
},
expand: true
});
})();