You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

llama.oldversion.chatsession-1.md 2.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # ChatSession<T>
  2. Namespace: LLama.OldVersion
  3. #### Caution
  4. The entire LLama.OldVersion namespace will be removed
  5. ---
  6. ```csharp
  7. public class ChatSession<T>
  8. ```
  9. #### Type Parameters
  10. `T`<br>
  11. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [ChatSession&lt;T&gt;](./llama.oldversion.chatsession-1.md)
  12. ## Constructors
  13. ### **ChatSession(T)**
  14. ```csharp
  15. public ChatSession(T model)
  16. ```
  17. #### Parameters
  18. `model` T<br>
  19. ## Methods
  20. ### **Chat(String, String, String)**
  21. ```csharp
  22. public IEnumerable<string> Chat(string text, string prompt, string encoding)
  23. ```
  24. #### Parameters
  25. `text` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  26. `prompt` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  27. `encoding` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  28. #### Returns
  29. [IEnumerable&lt;String&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)<br>
  30. ### **WithPrompt(String, String)**
  31. ```csharp
  32. public ChatSession<T> WithPrompt(string prompt, string encoding)
  33. ```
  34. #### Parameters
  35. `prompt` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  36. `encoding` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  37. #### Returns
  38. [ChatSession&lt;T&gt;](./llama.oldversion.chatsession-1.md)<br>
  39. ### **WithPromptFile(String, String)**
  40. ```csharp
  41. public ChatSession<T> WithPromptFile(string promptFilename, string encoding)
  42. ```
  43. #### Parameters
  44. `promptFilename` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  45. `encoding` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  46. #### Returns
  47. [ChatSession&lt;T&gt;](./llama.oldversion.chatsession-1.md)<br>
  48. ### **WithAntiprompt(String[])**
  49. Set the keywords to split the return value of chat AI.
  50. ```csharp
  51. public ChatSession<T> WithAntiprompt(String[] antiprompt)
  52. ```
  53. #### Parameters
  54. `antiprompt` [String[]](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  55. #### Returns
  56. [ChatSession&lt;T&gt;](./llama.oldversion.chatsession-1.md)<br>