@convo-lang/convo-lang-pdf 0.7.24 → 0.7.25

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 (2) hide show
  1. package/README.md +429 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,429 @@
1
+ # Convo-Lang
2
+ A Conversational Language
3
+
4
+ ![convo](https://raw.githubusercontent.com/convo-lang/convo-lang/refs/heads/main/assets/learn-convo-demo.webp)
5
+
6
+ **Interactive Demo** - [https://learn.convo-lang.ai/playground](https://learn.convo-lang.ai/playground)
7
+
8
+ **Convo-Lang Tutorial** - [https://learn.convo-lang.ai/learn](https://learn.convo-lang.ai/learn)
9
+
10
+ **GitHub** - [ https://github.com/convo-lang/convo-lang](https://github.com/convo-lang/convo-lang)
11
+
12
+ **NPM** - [https://www.npmjs.com/package/@convo-lang/convo-lang](https://www.npmjs.com/package/@convo-lang/convo-lang)
13
+
14
+ **VSCode Extension** - [https://marketplace.visualstudio.com/items?itemName=iyio.convo-lang-tools](https://marketplace.visualstudio.com/items?itemName=iyio.convo-lang-tools)
15
+
16
+
17
+ ## What is Convo-Lang?
18
+ Convo-Lang is a programming language built from the ground up for prompt engineers and AI application
19
+ developers. The goal of Convo-Lang is to simplify to development of LLM based applications and
20
+ provided a uniform syntax for working with all LLMs.
21
+
22
+ Convo-Lang is a mixture between a procedural programming language, prompting template system and
23
+ conversation state management system. You can execute convo-lang in Javascript, Python,
24
+ from the command line or directly in VSCode.
25
+
26
+ Convo-Lang aims to provided a uniform prompting syntax that is LLM agnostic and allows you to
27
+ store both prompts, metadata and tradition programming logic in a single file or template string.
28
+
29
+ The convo-lang syntax supports advanced features such as function calling, tool usage and vision.
30
+ The Convo-Lang ecosystem consists of a parser, interpreter, Typescript/Javascript/Python libraries,
31
+ a CLI, and a vscode extension for syntax highlighting and in-editor script execution.
32
+
33
+
34
+ ## Packages
35
+ - @convo-lang/convo-lang - Contains the Convo-Lang Conversation Engine, and a Typescript/Javascript library to use Convo-Lang in your application.
36
+ - @convo-lang/convo-lang-react - Contains UI pre-built UI components including a fully functional chat component.
37
+ - @convo-lang/convo-lang-openai - Conversation adapter for OpenAI.
38
+ - @convo-lang/convo-lang-bedrock - Conversation adapter for AWS Bedrock.
39
+ - @convo-lang/convo-lang-api-routes - A backend for relaying messages between the browser and LLM backends such as OpenAI.
40
+ - @convo-lang/convo-vfs - Used to integrate Convo-Lang into virtual file systems.
41
+ - @convo-lang/convo-lang-cli - A CLI interface that allows you to execute and parse convo-lang files.
42
+ - @convo-lang/convo-lang-tools - Contains the convo-lang vscode extension, which includes syntax highlighting,
43
+ in-editor script execution, script parsing, and other helpful tools for working with convo-lang.
44
+ In most cases, you will not install this package but instead install the vscode convo-lang extension.
45
+
46
+
47
+ ## Quick Start with NextJS
48
+ You can use the `npx convo --create-next-app` command to quickly get started building AI Agents powered
49
+ by Convo-Lang in a NextJS project
50
+
51
+ **Step 1:** Create project using convo CLI
52
+ ``` sh
53
+ npx convo --create-next-app
54
+ ```
55
+
56
+ **Step 1:** Open newly created project in VSCode or your favorite editor
57
+ ``` sh
58
+ # Open project directory
59
+ cd {NEWLY_CREATED_PROJECT_NAME}
60
+
61
+ # Open Code Editor
62
+ code .
63
+ # -or-
64
+ vim .
65
+ # -or-
66
+ # Use GUI
67
+ ```
68
+
69
+ **Step 3:** Copy example env file to `.env.development`
70
+ ``` sh
71
+ cp example.env.development .env.development
72
+ ```
73
+
74
+ **Step 4:** Add your OpenAI API key to `.env.development`
75
+ ``` conf
76
+ OPENAI_API_KEY={YOUR_OPEN_AI_API_KEY}
77
+ ```
78
+
79
+ **Step 5:** Start the NextJS server
80
+ ``` sh
81
+ npm run dev
82
+ ```
83
+
84
+ **Step 6:** Start modifying example agent prompts in any of the example pages
85
+ - pages/index.tsx: Routing agent that opens requested agent
86
+ - pages/agent/todo-list.tsx: Todo list agent that can manage a todo list
87
+ - pages/agent/video-dude.tsx: A video player agent that plays the best YouTube videos
88
+ - pages/agent/weather.tsx: A weather man agent that can tell you the weather anywhere in the world
89
+
90
+
91
+ ## Model Provider Support
92
+
93
+ - OpenAI - https://platform.openai.com/docs/models
94
+ - chatgpt-4o-latest
95
+ - gpt-3.5-turbo
96
+ - gpt-3.5-turbo-0125
97
+ - gpt-3.5-turbo-1106
98
+ - gpt-3.5-turbo-16k
99
+ - gpt-4
100
+ - gpt-4-0125-preview
101
+ - gpt-4-0613
102
+ - gpt-4-1106-preview
103
+ - gpt-4-turbo
104
+ - gpt-4-turbo-2024-04-09
105
+ - gpt-4-turbo-preview
106
+ - gpt-4o
107
+ - gpt-4o-2024-05-13
108
+ - gpt-4o-2024-08-06
109
+ - gpt-4o-mini
110
+ - gpt-4o-mini-2024-07-18
111
+ - o1-mini
112
+ - o1-mini-2024-09-12
113
+ - o1-preview
114
+ - o1-preview-2024-09-12
115
+
116
+ - OpenAI Chat Completions Compatible APIs
117
+ - LM Studio - https://lmstudio.ai/docs/app/api/endpoints/openai
118
+ - Ollama - https://ollama.com/blog/openai-compatibility
119
+ - Llama.cpp - https://github.com/ggml-org/llama.cpp/tree/master/tools/server
120
+
121
+ - AWS Bedrock - https://aws.amazon.com/bedrock/
122
+ - us.amazon.nova-lite-v1:0
123
+ - us.amazon.nova-micro-v1:0
124
+ - us.amazon.nova-pro-v1:0
125
+ - us.anthropic.claude-3-5-haiku-20241022-v1:0
126
+ - us.anthropic.claude-3-5-sonnet-20240620-v1:0
127
+ - us.anthropic.claude-3-5-sonnet-20241022-v2:0
128
+ - us.anthropic.claude-3-7-sonnet-20250219-v1:0
129
+ - us.anthropic.claude-3-haiku-20240307-v1:0
130
+ - us.anthropic.claude-opus-4-20250514-v1:0
131
+ - us.anthropic.claude-sonnet-4-20250514-v1:0
132
+ - us.deepseek.r1-v1:0
133
+ - us.meta.llama3-1-70b-instruct-v1:0
134
+ - us.meta.llama3-1-8b-instruct-v1:0
135
+ - us.meta.llama3-2-11b-instruct-v1:0
136
+ - us.meta.llama3-2-1b-instruct-v1:0
137
+ - us.meta.llama3-2-3b-instruct-v1:0
138
+ - us.meta.llama3-2-90b-instruct-v1:0
139
+ - us.meta.llama3-3-70b-instruct-v1:0
140
+ - us.meta.llama4-maverick-17b-instruct-v1:0
141
+ - us.meta.llama4-scout-17b-instruct-v1:0
142
+ - us.mistral.pixtral-large-2502-v1:0
143
+
144
+
145
+ ## VSCode extension
146
+ You will also probably want to install the vscode extension for syntax highlighting and other
147
+ developer niceties. You can install the vscode extension by searching for "convo-lang" in the
148
+ vscode extension tab.
149
+
150
+ https://marketplace.visualstudio.com/items?itemName=iyio.convo-lang-tools
151
+
152
+
153
+ ## Using Convo-Lang
154
+ When using Convo-Lang in a TypeScript or JavaScript project will use the Convo-Lang Conversation Engine
155
+ by creating instances of the `Conversation` class and appending messages and awaiting the
156
+ completion of those messages. Conversations are made up of collections of messages that represent
157
+ messages from the user, LLM, tool definitions and more.
158
+
159
+ Install Convo-Lang packages
160
+ ``` sh
161
+ npm install @convo-lang/convo-lang @convo-lang/convo-lang-openai
162
+ ```
163
+
164
+ *(note - syntax highlighting for Convo-Lang embedded in string template literals is provided using the "convo-lang" VSCode extension)*
165
+ ``` js
166
+ // example.mjs
167
+ import { Conversation } from "@convo-lang/convo-lang";
168
+ import { initOpenAiBackend } from '@convo-lang/convo-lang-openai';
169
+
170
+ initOpenAiBackend();
171
+ const conversation=new Conversation();
172
+
173
+
174
+ await conversation.completeAsync(/*convo*/`
175
+ > system
176
+ You are a super smart and funny astronomer that love make funny quotes
177
+
178
+ > define
179
+ Planet = struct(
180
+ name: string
181
+ moonCount: number
182
+ quote: string
183
+ )
184
+
185
+ @json Planet[]
186
+ > user
187
+ List the planets in our solar system
188
+ `);
189
+
190
+
191
+ console.log(conversation.convo);
192
+ ```
193
+
194
+ ``` sh
195
+ # Set the OPENAI_API_KEY env var however you see fit
196
+ export OPENAI_API_KEY=sk-___YOUR_KEY___
197
+
198
+ node example.mjs
199
+
200
+ ```
201
+
202
+ Output:
203
+ ``` convo
204
+ @format json
205
+ > assistant
206
+ [
207
+ {
208
+ "name": "Mercury",
209
+ "moonCount": 0,
210
+ "quote": "I'm Mercury. I don't have any moons, but who needs them when you're this close to the Sun? 🍳"
211
+ },
212
+ {
213
+ "name": "Venus",
214
+ "moonCount": 0,
215
+ "quote": "Venus here! No moons in sight, but you should see my cloud cover. It's haute couture! ☁️👗"
216
+ },
217
+ {
218
+ "name": "Earth",
219
+ "moonCount": 1,
220
+ "quote": "Earth, the only planet with pizza! Oh, and one moon which we keep for dramatic lunar eclipses. 🌕🍕"
221
+ },
222
+ {
223
+ "name": "Mars",
224
+ "moonCount": 2,
225
+ "quote": "Mars calling! With my two moons, Phobos and Deimos, I basically have my own double feature in the sky! 🎬🌌"
226
+ },
227
+ {
228
+ "name": "Jupiter",
229
+ "moonCount": 79,
230
+ "quote": "Jupiter, moon hoarder extraordinaire! With 79 moons, my nightly show is never the same—it's cosmic channel surfing! 📺🌔"
231
+ },
232
+ {
233
+ "name": "Saturn",
234
+ "moonCount": 83,
235
+ "quote": "Saturn here, all about those rings AND 83 moons! Talk about accessories stealing the spotlight! 💍🌕"
236
+ },
237
+ {
238
+ "name": "Uranus",
239
+ "moonCount": 27,
240
+ "quote": "Uranus checking in! With 27 moons, I have more natural satellites than most people have friends. 🌑👽"
241
+ },
242
+ {
243
+ "name": "Neptune",
244
+ "moonCount": 14,
245
+ "quote": "Neptune, ruler of the deep space! With 14 moons, I'm never alone, even in the far reaches of the solar system. 🌊🔭"
246
+ }
247
+ ]
248
+ ```
249
+
250
+ ## NodeJs example project
251
+ The `convo-lang/convo-lang-node-example` repo contains a full featured CLI tool that can load
252
+ Convo-Lang scripts, accept messages over HTTP and accept live input.
253
+
254
+ https://github.com/convo-lang/convo-lang-node-example
255
+
256
+ ![NextJS example](https://github.com/convo-lang/convo-lang/blob/main/assets/convo-lang-node-example.webp?raw=true)
257
+
258
+
259
+
260
+ ## Using convo-lang in a existing NextJs project
261
+ Follow the step below to you Convo-Lang in an existing NextJS project
262
+
263
+
264
+ Install packages:
265
+ ``` sh
266
+ npm i \
267
+ @convo-lang/convo-lang \
268
+ @convo-lang/convo-lang-react \
269
+ @convo-lang/convo-lang-openai \
270
+ @convo-lang/convo-lang-api-routes \
271
+ @iyio/nextjs-common \
272
+ @iyio/react-common \
273
+ @iyio/node-common
274
+ ```
275
+
276
+ Add API endpoint to `/pages/api/convo-lang/[convo-api-action].ts`. This API endpoint will be used
277
+ to relay messages between LLMs while keep your API secrets safe.
278
+ ``` ts
279
+ import { createRequestHandler } from "@/lib/api-handler";
280
+ import { createConvoLangApiRoutes } from "@convo-lang/convo-lang-api-routes";
281
+ import { initOpenAiBackend } from '@convo-lang/convo-lang-openai';
282
+
283
+ initOpenAiBackend();
284
+
285
+ const routes=createConvoLangApiRoutes({prefix:'/api/convo-lang/'});
286
+
287
+ const handler=createRequestHandler({routes});
288
+
289
+ export default handler;
290
+
291
+ ```
292
+
293
+ The code below creates a fully functional chat interface with a website assistant agent
294
+ ``` tsx
295
+ import { ConversationView } from "@convo-lang/convo-lang-react";
296
+ import { NextJsBaseLayoutView } from "@iyio/nextjs-common";
297
+
298
+ // For syntax highlighting of Convo-Lang install the Convo-Lang VSCode extension.
299
+ // Search for "convo-lang" in the extensions window.
300
+ const exampleConvo=/*convo*/`
301
+
302
+ > define
303
+ agentName='Doc'
304
+
305
+ > system
306
+ Your name is {{agentName}} and you're helping a user navigate a website
307
+
308
+ Pages:
309
+ - Dashboard: path = /
310
+ - Contact: path = /contact
311
+ - News: path = /news
312
+ - Profile: path = /users-place
313
+ - Projects: path = /project-jobs
314
+
315
+ > extern openPage(
316
+ # Path of page to open
317
+ path:string
318
+ )
319
+
320
+ > assistant
321
+ Hi 👋, I'm {{agentName}}. I'm here to help you navigate this awesome website
322
+
323
+ `
324
+
325
+
326
+ export function AgentView(){
327
+
328
+ return (
329
+ <NextJsBaseLayoutView>
330
+ <ConversationView
331
+ theme="dark"
332
+ showInputWithSource
333
+ enabledSlashCommands
334
+ template={exampleConvo}
335
+ httpEndpoint="/api/convo-lang"
336
+ externFunctions={{
337
+ openPage:async (path:string)=>{
338
+ window.history.pushState(null,'',path);
339
+ },
340
+ }}
341
+ />
342
+ </NextJsBaseLayoutView>
343
+ )
344
+
345
+ }
346
+
347
+ ```
348
+
349
+ ## NextJs example project
350
+ The `convo-lang/convo-lang-nextjs-example` repo contains a fully functional example of using Convo-Lang
351
+ in a NextJs project to create a collection of agents that can manipulate an interactive canvas.
352
+
353
+ https://github.com/convo-lang/convo-lang-nextjs-example
354
+
355
+ ![NextJS example](https://github.com/convo-lang/convo-lang/blob/main/assets/convo-lang-nextjs-example.webp?raw=true)
356
+
357
+
358
+
359
+ ## Using the convo-lang extension
360
+ With the convo vscode extension installed, you can execute convo scripts directly in vscode. Just
361
+ press **(CMD+R)** to run a script.
362
+
363
+ You can also run snippets of convo scripts that are embedded in other
364
+ document types. Just highlight the convo code you want to run, open the command palette, and
365
+ search for "Complete Convo Conversation" and press enter. Then the snippet will be opened in a new
366
+ convo file and completed. This is great for quick prototyping and testing prompts in your application
367
+ without having to start your full application.
368
+
369
+
370
+ ## Using the CLI
371
+ The convo CLI can be used to execute convo scripts from the command line
372
+
373
+ For use on the command line install the @convo-lang/convo-lang-cli package
374
+ ``` sh
375
+ npm i @convo-lang/convo-lang-cli -g
376
+ ```
377
+
378
+ ``` sh
379
+ # install the convo cli
380
+ npm i -g @convo-lang/convo-lang-cli
381
+
382
+ # Results will be printed to stdout
383
+ convo talky-time.convo
384
+
385
+ # Results will be written to a new file named something-happened.convo
386
+ convo talky-time.convo --out something.convo
387
+
388
+ # Result will be written to the source input file. This allows you to have a continuous conversation
389
+ convo talky-time.convo --out .
390
+ ```
391
+
392
+ There is currently only one way to configure the convo cli and vscode extension. This will be extended
393
+ soon to include reading configuration files from your current workspace.
394
+
395
+
396
+ ## CLI and extension configuration
397
+ To allow convo to access OpenAI, create a JSON file called ~/.config/convo/convo.json and add the
398
+ following contents. Remember to replace the API key with your OpenAI api key.
399
+
400
+ ``` json
401
+ {
402
+ "env":{
403
+ "openAiApiKey":"YOUR_OPEN_AI_KEY",
404
+ "openAiChatModel":"gpt-4o",
405
+ "openAiVisionModel":"gpt-4o",
406
+ "openAiAudioModel":"whisper-1",
407
+ "openAiImageModel":"dall-e-3"
408
+ }
409
+ }
410
+ ```
411
+
412
+ ## IYIO ( eye·o )
413
+ Convo-Lang uses many of the packages of the IYIO library and began as a package in the IYIO library.
414
+ IYIO is a collection of utilities and frameworks useful for many different situations.
415
+
416
+ IYIO - https://github.com/iyioio/common
417
+
418
+ ## Learn More
419
+ You can check out an interactive demo of Convo-Lang here - [https://learn.convo-lang.ai/playground](https://learn.convo-lang.ai/playground)
420
+
421
+ If you want to learn the Convo-Lang language check out this tutorial - [https://learn.convo-lang.ai/learn](https://learn.convo-lang.ai/learn)
422
+
423
+ ## Contact
424
+
425
+ Email - doc@convo-lang.ai
426
+
427
+ X - https://x.com/ConvoLang
428
+
429
+ Join our Discord Server - https://discord.gg/GyXp8Dsa
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convo-lang/convo-lang-pdf",
3
- "version": "0.7.24",
3
+ "version": "0.7.25",
4
4
  "sideEffects": false,
5
5
  "dependencies": {
6
6
  "@iyio/common": "^0.7.23",
@@ -13,7 +13,7 @@
13
13
  "zod": "^3.21.4"
14
14
  },
15
15
  "peerDependencies": {
16
- "@convo-lang/convo-lang": "0.7.24"
16
+ "@convo-lang/convo-lang": "0.7.25"
17
17
  },
18
18
  "main": "./src/index.js",
19
19
  "module": "./esm/src/index.js"