Skip to content

Commit d08ac4a

Browse files
committed
docs: update the API references.
1 parent d150e1e commit d08ac4a

File tree

168 files changed

+8832
-8120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+8832
-8120
lines changed

docs/ContributingGuide.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,17 @@ There're mainly two ways to add an example:
107107
## Add documents
108108

109109
LLamaSharp uses [mkdocs](https://github.com/mkdocs/mkdocs) to build the documentation, please follow the tutorial of mkdocs to add or modify documents in LLamaSharp.
110+
111+
For API references, LLamaSharp takes use of [xmldoc2md](https://github.com/charlesdevandiere/xmldoc2md) to generate the documentation of markdown format. If you want to update the files in `docs/xmldocs`, please run the following commands.
112+
113+
```
114+
dotnet tool install -g XMLDoc2Markdown
115+
cd LLama/bin/Debug/net8 # change the path to your bin path.
116+
dotnet xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button
117+
```
118+
119+
Specifically, if the xmldoc2md cannot be found by dotnet cli, please replace the `dotnet xmldoc2md` with the executable file, like below.
120+
121+
```
122+
C:\Users\liu_y\.dotnet\tools\xmldoc2md.exe LLamaSharp.dll -o ../../../../docs/xmldocs --back-button
123+
```

docs/xmldocs/index.md

Lines changed: 72 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
[LLamaQuantizer](./llama.llamaquantizer.md)
1818

19+
[LLamaReranker](./llama.llamareranker.md)
20+
21+
[LLamaTemplate](./llama.llamatemplate.md)
22+
1923
[LLamaTransforms](./llama.llamatransforms.md)
2024

2125
[LLamaWeights](./llama.llamaweights.md)
@@ -32,8 +36,6 @@
3236

3337
## LLama.Abstractions
3438

35-
[AdapterCollection](./llama.abstractions.adaptercollection.md)
36-
3739
[IContextParams](./llama.abstractions.icontextparams.md)
3840

3941
[IHistoryTransform](./llama.abstractions.ihistorytransform.md)
@@ -46,16 +48,22 @@
4648

4749
[IModelParams](./llama.abstractions.imodelparams.md)
4850

51+
[INativeLibrary](./llama.abstractions.inativelibrary.md)
52+
53+
[INativeLibrarySelectingPolicy](./llama.abstractions.inativelibraryselectingpolicy.md)
54+
4955
[ITextStreamTransform](./llama.abstractions.itextstreamtransform.md)
5056

5157
[ITextTransform](./llama.abstractions.itexttransform.md)
5258

53-
[LoraAdapter](./llama.abstractions.loraadapter.md)
59+
[LLamaExecutorExtensions](./llama.abstractions.llamaexecutorextensions.md)
5460

5561
[MetadataOverride](./llama.abstractions.metadataoverride.md)
5662

5763
[MetadataOverrideConverter](./llama.abstractions.metadataoverrideconverter.md)
5864

65+
[TensorBufferOverride](./llama.abstractions.tensorbufferoverride.md)
66+
5967
[TensorSplitsCollection](./llama.abstractions.tensorsplitscollection.md)
6068

6169
[TensorSplitsCollectionConverter](./llama.abstractions.tensorsplitscollectionconverter.md)
@@ -66,14 +74,14 @@
6674

6775
[BatchedExecutor](./llama.batched.batchedexecutor.md)
6876

69-
[CannotForkWhileRequiresInferenceException](./llama.batched.cannotforkwhilerequiresinferenceexception.md)
70-
7177
[CannotModifyWhileRequiresInferenceException](./llama.batched.cannotmodifywhilerequiresinferenceexception.md)
7278

7379
[CannotSampleRequiresInferenceException](./llama.batched.cannotsamplerequiresinferenceexception.md)
7480

7581
[CannotSampleRequiresPromptException](./llama.batched.cannotsamplerequirespromptexception.md)
7682

83+
[CannotSaveWhileRequiresInferenceException](./llama.batched.cannotsavewhilerequiresinferenceexception.md)
84+
7785
[Conversation](./llama.batched.conversation.md)
7886

7987
[ConversationExtensions](./llama.batched.conversationextensions.md)
@@ -96,74 +104,58 @@
96104

97105
## LLama.Exceptions
98106

99-
[GrammarExpectedName](./llama.exceptions.grammarexpectedname.md)
100-
101-
[GrammarExpectedNext](./llama.exceptions.grammarexpectednext.md)
102-
103-
[GrammarExpectedPrevious](./llama.exceptions.grammarexpectedprevious.md)
104-
105-
[GrammarFormatException](./llama.exceptions.grammarformatexception.md)
106-
107-
[GrammarUnexpectedCharAltElement](./llama.exceptions.grammarunexpectedcharaltelement.md)
108-
109-
[GrammarUnexpectedCharRngElement](./llama.exceptions.grammarunexpectedcharrngelement.md)
110-
111-
[GrammarUnexpectedEndElement](./llama.exceptions.grammarunexpectedendelement.md)
112-
113-
[GrammarUnexpectedEndOfInput](./llama.exceptions.grammarunexpectedendofinput.md)
114-
115-
[GrammarUnexpectedHexCharsCount](./llama.exceptions.grammarunexpectedhexcharscount.md)
116-
117-
[GrammarUnknownEscapeCharacter](./llama.exceptions.grammarunknownescapecharacter.md)
107+
[GetLogitsInvalidIndexException](./llama.exceptions.getlogitsinvalidindexexception.md)
118108

119109
[LLamaDecodeError](./llama.exceptions.llamadecodeerror.md)
120110

121111
[LoadWeightsFailedException](./llama.exceptions.loadweightsfailedexception.md)
122112

113+
[MissingTemplateException](./llama.exceptions.missingtemplateexception.md)
114+
123115
[RuntimeError](./llama.exceptions.runtimeerror.md)
124116

117+
[TemplateNotFoundException](./llama.exceptions.templatenotfoundexception.md)
118+
125119
## LLama.Extensions
126120

127121
[IContextParamsExtensions](./llama.extensions.icontextparamsextensions.md)
128122

129123
[IModelParamsExtensions](./llama.extensions.imodelparamsextensions.md)
130124

131-
## LLama.Grammars
132-
133-
[Grammar](./llama.grammars.grammar.md)
134-
135-
[GrammarRule](./llama.grammars.grammarrule.md)
125+
[SpanNormalizationExtensions](./llama.extensions.spannormalizationextensions.md)
136126

137127
## LLama.Native
138128

129+
[AvxLevel](./llama.native.avxlevel.md)
130+
139131
[DecodeResult](./llama.native.decoderesult.md)
140132

133+
[DefaultNativeLibrarySelectingPolicy](./llama.native.defaultnativelibraryselectingpolicy.md)
134+
135+
[EncodeResult](./llama.native.encoderesult.md)
136+
141137
[GGMLType](./llama.native.ggmltype.md)
142138

143139
[GPUSplitMode](./llama.native.gpusplitmode.md)
144140

145-
[LLamaBatch](./llama.native.llamabatch.md)
141+
[ICustomSampler](./llama.native.icustomsampler.md)
142+
143+
[LLamaAttentionType](./llama.native.llamaattentiontype.md)
146144

147-
[LLamaBeamsState](./llama.native.llamabeamsstate.md)
145+
[LLamaBatch](./llama.native.llamabatch.md)
148146

149-
[LLamaBeamView](./llama.native.llamabeamview.md)
147+
[LLamaBatchEmbeddings](./llama.native.llamabatchembeddings.md)
150148

151149
[LLamaChatMessage](./llama.native.llamachatmessage.md)
152150

153151
[LLamaContextParams](./llama.native.llamacontextparams.md)
154152

155153
[LLamaFtype](./llama.native.llamaftype.md)
156154

157-
[LLamaGrammarElement](./llama.native.llamagrammarelement.md)
158-
159-
[LLamaGrammarElementType](./llama.native.llamagrammarelementtype.md)
160-
161-
[LLamaKvCacheView](./llama.native.llamakvcacheview.md)
162-
163-
[LLamaKvCacheViewCell](./llama.native.llamakvcacheviewcell.md)
164-
165155
[LLamaKvCacheViewSafeHandle](./llama.native.llamakvcacheviewsafehandle.md)
166156

157+
[LLamaLogitBias](./llama.native.llamalogitbias.md)
158+
167159
[LLamaLogLevel](./llama.native.llamaloglevel.md)
168160

169161
[LLamaModelKvOverrideType](./llama.native.llamamodelkvoverridetype.md)
@@ -174,60 +166,94 @@
174166

175167
[LLamaModelQuantizeParams](./llama.native.llamamodelquantizeparams.md)
176168

169+
[LLamaModelTensorBufferOverride](./llama.native.llamamodeltensorbufferoverride.md)
170+
177171
[LLamaNativeBatch](./llama.native.llamanativebatch.md)
178172

173+
[LLamaPerfContextTimings](./llama.native.llamaperfcontexttimings.md)
174+
179175
[LLamaPoolingType](./llama.native.llamapoolingtype.md)
180176

181177
[LLamaPos](./llama.native.llamapos.md)
182178

183179
[LLamaRopeType](./llama.native.llamaropetype.md)
184180

181+
[LLamaSamplerChainParams](./llama.native.llamasamplerchainparams.md)
182+
183+
[LLamaSamplingTimings](./llama.native.llamasamplingtimings.md)
184+
185185
[LLamaSeqId](./llama.native.llamaseqid.md)
186186

187187
[LLamaToken](./llama.native.llamatoken.md)
188188

189+
[LLamaTokenAttr](./llama.native.llamatokenattr.md)
190+
189191
[LLamaTokenData](./llama.native.llamatokendata.md)
190192

191193
[LLamaTokenDataArray](./llama.native.llamatokendataarray.md)
192194

193195
[LLamaTokenDataArrayNative](./llama.native.llamatokendataarraynative.md)
194196

195-
[LLamaTokenType](./llama.native.llamatokentype.md)
196-
197197
[LLamaVocabType](./llama.native.llamavocabtype.md)
198198

199199
[LLavaImageEmbed](./llama.native.llavaimageembed.md)
200200

201+
[LoraAdapter](./llama.native.loraadapter.md)
202+
201203
[NativeApi](./llama.native.nativeapi.md)
202204

203205
[NativeLibraryConfig](./llama.native.nativelibraryconfig.md)
204206

207+
[NativeLibraryConfigContainer](./llama.native.nativelibraryconfigcontainer.md)
208+
209+
[NativeLibraryFromPath](./llama.native.nativelibraryfrompath.md)
210+
211+
[NativeLibraryMetadata](./llama.native.nativelibrarymetadata.md)
212+
213+
[NativeLibraryName](./llama.native.nativelibraryname.md)
214+
215+
[NativeLibraryWithAvx](./llama.native.nativelibrarywithavx.md)
216+
217+
[NativeLibraryWithCuda](./llama.native.nativelibrarywithcuda.md)
218+
219+
[NativeLibraryWithMacOrFallback](./llama.native.nativelibrarywithmacorfallback.md)
220+
221+
[NativeLibraryWithVulkan](./llama.native.nativelibrarywithvulkan.md)
222+
223+
[NativeLogConfig](./llama.native.nativelogconfig.md)
224+
205225
[RopeScalingType](./llama.native.ropescalingtype.md)
206226

207227
[SafeLLamaContextHandle](./llama.native.safellamacontexthandle.md)
208228

209-
[SafeLLamaGrammarHandle](./llama.native.safellamagrammarhandle.md)
210-
211229
[SafeLLamaHandleBase](./llama.native.safellamahandlebase.md)
212230

213231
[SafeLlamaModelHandle](./llama.native.safellamamodelhandle.md)
214232

233+
[SafeLLamaSamplerChainHandle](./llama.native.safellamasamplerchainhandle.md)
234+
215235
[SafeLlavaImageEmbedHandle](./llama.native.safellavaimageembedhandle.md)
216236

217237
[SafeLlavaModelHandle](./llama.native.safellavamodelhandle.md)
218238

239+
[SystemInfo](./llama.native.systeminfo.md)
240+
241+
[UnknownNativeLibrary](./llama.native.unknownnativelibrary.md)
242+
219243
## LLama.Sampling
220244

221245
[BaseSamplingPipeline](./llama.sampling.basesamplingpipeline.md)
222246

223247
[DefaultSamplingPipeline](./llama.sampling.defaultsamplingpipeline.md)
224248

249+
[Grammar](./llama.sampling.grammar.md)
250+
225251
[GreedySamplingPipeline](./llama.sampling.greedysamplingpipeline.md)
226252

227253
[ISamplingPipeline](./llama.sampling.isamplingpipeline.md)
228254

229255
[ISamplingPipelineExtensions](./llama.sampling.isamplingpipelineextensions.md)
230256

231-
[Mirostate2SamplingPipeline](./llama.sampling.mirostate2samplingpipeline.md)
257+
## LLama.Transformers
232258

233-
[MirostateSamplingPipeline](./llama.sampling.mirostatesamplingpipeline.md)
259+
[PromptTemplateTransformer](./llama.transformers.prompttemplatetransformer.md)

docs/xmldocs/llama.abstractions.adaptercollection.md

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)