ctod 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/examples/basic.ts +97 -0
  2. package/examples/llama.cpp.ts +56 -0
  3. package/examples/plugin.ts +118 -0
  4. package/lib/broker/chat.ts +435 -0
  5. package/lib/core/parser.ts +62 -0
  6. package/lib/core/plugin.ts +46 -0
  7. package/lib/core/translator.ts +115 -0
  8. package/lib/ctod.ts +71 -0
  9. package/lib/index.ts +41 -0
  10. package/lib/plugins/index.ts +38 -0
  11. package/lib/plugins/limiter.ts +103 -0
  12. package/lib/plugins/print-log.ts +35 -0
  13. package/lib/plugins/retry.ts +25 -0
  14. package/lib/plugins/role.ts +28 -0
  15. package/lib/service/llama3.cpp/completion.ts +313 -0
  16. package/lib/service/llama3.cpp/index.ts +53 -0
  17. package/lib/service/openai/chat.ts +244 -0
  18. package/lib/service/openai/images-generation.ts +64 -0
  19. package/lib/service/openai/index.ts +97 -0
  20. package/lib/service/openai/vision.ts +111 -0
  21. package/lib/shims.d.ts +4 -0
  22. package/lib/templates.ts +71 -0
  23. package/lib/types.ts +4 -0
  24. package/lib/utils/error.ts +14 -0
  25. package/lib/utils/validate.ts +64 -0
  26. package/package.json +1 -1
  27. package/types/examples/basic.d.ts +1 -0
  28. package/types/examples/chat-demo.d.ts +2 -0
  29. package/types/examples/chat-for-llama.cpp-demo.d.ts +2 -0
  30. package/types/examples/chat-with-json-schema-demo.d.ts +2 -0
  31. package/types/examples/llama.cpp.d.ts +2 -0
  32. package/types/examples/plugin-demo.d.ts +2 -0
  33. package/types/examples/plugin.d.ts +2 -0
  34. package/types/examples/stream-for-llama.cpp-demo.d.ts +2 -0
  35. package/types/examples/vision-demo.d.ts +2 -0
  36. package/types/lib/broker/chat.d.ts +150 -0
  37. package/types/lib/core/parser.d.ts +32 -0
  38. package/types/lib/core/plugin.d.ts +34 -0
  39. package/types/lib/core/translator.d.ts +67 -0
  40. package/types/lib/ctod.d.ts +32 -0
  41. package/types/lib/index.d.ts +34 -0
  42. package/types/lib/plugins/index.d.ts +47 -0
  43. package/types/lib/plugins/limiter.d.ts +36 -0
  44. package/types/lib/plugins/print-log.d.ts +5 -0
  45. package/types/lib/plugins/retry.d.ts +6 -0
  46. package/types/lib/plugins/role.d.ts +5 -0
  47. package/types/lib/service/llama3.cpp/completion.d.ts +61 -0
  48. package/types/lib/service/llama3.cpp/index.d.ts +19 -0
  49. package/types/lib/service/openai/chat.d.ts +110 -0
  50. package/types/lib/service/openai/completion.d.ts +59 -0
  51. package/types/lib/service/openai/images-generation.d.ts +35 -0
  52. package/types/lib/service/openai/index.d.ts +29 -0
  53. package/types/lib/service/openai/vision.d.ts +74 -0
  54. package/types/lib/templates.d.ts +20 -0
  55. package/types/lib/types.d.ts +1 -0
  56. package/types/lib/utils/error.d.ts +11 -0
  57. package/types/lib/utils/validate.d.ts +16 -0
  58. package/.api-key +0 -1
  59. package/.nyc_output/42919e68-b472-4a5d-b2d3-5d5153f28467.json +0 -1
  60. package/.nyc_output/processinfo/42919e68-b472-4a5d-b2d3-5d5153f28467.json +0 -1
  61. package/.nyc_output/processinfo/index.json +0 -1
  62. package/.output/.output/stores//344/270/200/345/240/264/346/234/237/345/276/205/345/267/262/344/271/205/347/232/204/345/222/214/350/247/243/cover-0.png +0 -1
  63. package/.output/.output/stores//344/270/200/345/240/264/346/234/237/345/276/205/345/267/262/344/271/205/347/232/204/345/222/214/350/247/243/cover-1.png +0 -1
  64. package/.output/.output/stores//344/270/200/345/240/264/346/234/237/345/276/205/345/267/262/344/271/205/347/232/204/345/222/214/350/247/243/story-config.json +0 -4
  65. package/.output/.output/stores//344/270/200/345/240/264/346/234/237/345/276/205/345/267/262/344/271/205/347/232/204/345/222/214/350/247/243/story.json +0 -22
  66. package/.output/.output/stores//345/276/236/351/273/221/346/232/227/350/265/260/345/220/221/345/205/211/346/230/216/cover-0.png +0 -1
  67. package/.output/.output/stores//345/276/236/351/273/221/346/232/227/350/265/260/345/220/221/345/205/211/346/230/216/cover-1.png +0 -1
  68. package/.output/.output/stores//345/276/236/351/273/221/346/232/227/350/265/260/345/220/221/345/205/211/346/230/216/story-config.json +0 -4
  69. package/.output/.output/stores//345/276/236/351/273/221/346/232/227/350/265/260/345/220/221/345/205/211/346/230/216/story.json +0 -24
  70. package/.output/.output/stores//347/240/264/347/242/216/347/232/204/345/271/273/350/261/241/cover-0.png +0 -1
  71. package/.output/.output/stores//347/240/264/347/242/216/347/232/204/345/271/273/350/261/241/cover-1.png +0 -1
  72. package/.output/.output/stores//347/240/264/347/242/216/347/232/204/345/271/273/350/261/241/story-config.json +0 -4
  73. package/.output/.output/stores//347/240/264/347/242/216/347/232/204/345/271/273/350/261/241/story.json +0 -24
  74. package/.output/.output/stores//350/227/235/350/241/223/345/256/266/347/232/204/351/235/210/346/204/237/cover-0.png +0 -1
  75. package/.output/.output/stores//350/227/235/350/241/223/345/256/266/347/232/204/351/235/210/346/204/237/cover-1.png +0 -1
  76. package/.output/.output/stores//350/227/235/350/241/223/345/256/266/347/232/204/351/235/210/346/204/237/story-config.json +0 -4
  77. package/.output/.output/stores//350/227/235/350/241/223/345/256/266/347/232/204/351/235/210/346/204/237/story.json +0 -28
  78. package/.output/.output/stores//350/250/230/346/206/266/345/225/206/344/272/272/cover-0.png +0 -1
  79. package/.output/.output/stores//350/250/230/346/206/266/345/225/206/344/272/272/cover-1.png +0 -1
  80. package/.output/.output/stores//350/250/230/346/206/266/345/225/206/344/272/272/story-config.json +0 -4
  81. package/.output/.output/stores//350/250/230/346/206/266/345/225/206/344/272/272/story.json +0 -18
  82. package/.output/.output/stores//350/250/255/350/250/210/350/210/207/351/226/213/347/231/274/347/232/204/346/214/221/346/210/260/content.json +0 -22
  83. package/.output/.output/talks//344/273/245/347/254/221/350/251/261/347/202/272/345/237/272/347/244/216/347/232/204/351/235/242/350/251/246/content.json +0 -30
  84. package/.output/.output/talks//344/273/245/347/254/221/350/251/261/347/202/272/345/237/272/347/244/216/347/232/204/351/235/242/350/251/246/cover-1684055229695.png +0 -0
  85. package/.output/.output/talks//345/234/250/346/224/277/346/262/273/345/200/231/351/201/270/344/272/272/350/276/257/350/253/226/344/270/255/347/232/204/350/252/252/346/234/215/346/200/247/346/272/235/351/200/232/content.json +0 -30
  86. package/.output/.output/talks//345/234/250/346/224/277/346/262/273/345/200/231/351/201/270/344/272/272/350/276/257/350/253/226/344/270/255/347/232/204/350/252/252/346/234/215/346/200/247/346/272/235/351/200/232/cover-1684056611678.png +0 -0
  87. package/.output/.output/talks//346/224/276/351/254/206/347/232/204/345/200/231/351/201/270/344/272/272/351/200/262/350/241/214/346/224/277/346/262/273/350/276/257/350/253/226/content.json +0 -36
  88. package/.output/.output/talks//346/224/276/351/254/206/347/232/204/345/200/231/351/201/270/344/272/272/351/200/262/350/241/214/346/224/277/346/262/273/350/276/257/350/253/226/cover-1684055140609.png +0 -0
  89. package/.output/.output/talks//346/224/277/346/262/273/347/254/221/350/251/261/content.json +0 -30
  90. package/.output/.output/talks//346/224/277/346/262/273/347/254/221/350/251/261/cover-1684056246465.png +0 -0
  91. package/.output/.output/talks//350/251/274/350/253/247/345/256/266/351/225/267/346/225/231/345/270/253/346/234/203/350/255/260/content.json +0 -26
  92. package/.output/.output/talks//350/251/274/350/253/247/345/256/266/351/225/267/346/225/231/345/270/253/346/234/203/350/255/260/cover-1685785935121.png +0 -0
  93. package/.output/.output/talks//350/262/241/345/213/231/351/241/247/345/225/217/350/253/256/350/251/242/content.json +0 -26
  94. package/.output/.output/talks//350/262/241/345/213/231/351/241/247/345/225/217/350/253/256/350/251/242/cover-1685785115833.png +0 -0
  95. package/.output/.output/talks//351/206/253/347/224/237/345/222/214/347/227/205/344/272/272/350/250/216/350/253/226/346/202/262/345/202/267/content.json +0 -32
  96. package/.output/.output/talks//351/206/253/347/224/237/345/222/214/347/227/205/344/272/272/350/250/216/350/253/226/346/202/262/345/202/267/cover-1684055075942.png +0 -0
@@ -1,22 +0,0 @@
1
- {
2
- "enUsOutline": "A family reconciles after years of estrangement.",
3
- "zhTwOutline": "一個家庭在多年的分裂後和解。",
4
- "enUsTitle": "The Long-Awaited Reconciliation",
5
- "zhTwTitle": "一場期待已久的和解",
6
- "enUsContent": [
7
- "Growing up, Emily always felt like the black sheep of her family. Her parents favored her older brother, who was a straight-A student and star athlete. Emily struggled with school and never found her passion. She felt like her parents didn't understand her. As a result, she distanced herself from her family and moved across the country after college.",
8
- "After years of barely speaking to her parents and brother, Emily received a phone call from her mother. Her father was diagnosed with a serious illness, and the family needed to come together to care for him. Emily reluctantly returned home and was surprised when her family welcomed her back with open arms.",
9
- "During her father's recovery, Emily spent time with her family and overcame old grudges and resentments. She learned more about her brother's struggles with anxiety and depression and felt closer to him than ever before. She also realized that her parents loved her for who she was and were proud of her accomplishments.",
10
- "After her father's condition stabilized, the family gathered together for a meal. For the first time in years, they talked and laughed and enjoyed each other's company. Emily felt overwhelmed with gratitude for her family and realized that she had been missing out on valuable relationships all these years. She made amends with her family and promised to keep in touch, no matter how far away she was.",
11
- "The family continued to support each other through good times and bad. They celebrated each other's milestones and were there to comfort each other during hard times. Emily felt like she finally found her place in her family and was grateful for the second chance to build those relationships.",
12
- "After years of estrangement, Emily's family reconciled and emerged stronger and more connected than ever before."
13
- ],
14
- "zhTwContent": [
15
- "艾蜜莉從小就覺得自己是家裡的異類。她的父母偏愛她成績優秀的哥哥,而他哥哥也是一個優秀的運動員。艾蜜莉在學校學習上遇到了困難,也沒有找到自己的興趣愛好。她覺得父母不了解她。因此,她與家人保持距離,大學畢業後離開了這個家,前往全國其他城市工作。",
16
- "多年來,艾蜜莉和父母以及哥哥幾乎不見面。有一天,她接到母親的電話,得知父親被診斷出患有嚴重的疾病,需要家人的照顧。艾蜜莉猶豫了一下,還是返回家鄉。令她驚訝的是,家人熱情地歡迎她回來。",
17
- "在父親恢復期間,艾蜜莉花時間和家人在一起,克服過去的怨恨和憤怒。她了解到哥哥患有焦慮和抑鬱症的困難,比以往更親密。她還意識到父母愛她,為她的成就感到自豪。",
18
- "父親的情況穩定後,家人聚在一起吃飯。多年來,他們第一次可以開心地聊天、笑聲不斷。艾蜜莉感激家人,意識到這些年她一直錯失了與家人相處的寶貴時光。她與家人和解,並承諾以後會與他們保持聯繫,無論她身在何處。",
19
- "家人繼續在好壞時期互相支持,慶祝彼此的里程碑,並在難時互相慰問。艾蜜莉感覺自己終於找到了在家庭中的位置,並感謝自己能夠重新建立這些關係的機會。",
20
- "多年分裂之後,艾蜜莉的家人和解了,他們變得更加堅強,更加緊密連結。"
21
- ]
22
- }