Skip to content

Commit 727475b

Browse files
committed
2 parents 0b30e46 + 1ac1d3c commit 727475b

7 files changed

Lines changed: 516 additions & 16 deletions

File tree

docs/src/.vuepress/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { defineClientConfig } from 'vuepress/client'
22
import VueMermaidString from 'vue-mermaid-string'
3+
import RestLlmTester from '../5.services/RestLlmTester.vue'
34

45
export default defineClientConfig({
56
enhance({ app, router, siteData }) {
67
app.component('Mermaid', VueMermaidString)
8+
app.component('RestLlmTester', RestLlmTester)
79
},
810
setup() { },
911
rootComponents: [],

docs/src/2.prompt/README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -569,39 +569,44 @@ class A main
569569

570570
### Testing
571571

572-
Testing is a prompt engineering technique that involves providing a test case for a given code snippet or function. This technique is useful for developers who want to test their code or for those who want to ensure the correctness of their code.
572+
You can ask a LLM to provide a test case for a given code snippet or function:
573+
574+
`Generate unit tests for the following function using [test framework] in [programming language]`
573575

574576
### System design and architecture
575577

576-
System design and architecture is a prompt engineering technique that involves providing a system design or architecture for a given code snippet or function. This technique is useful for developers who want to design their code or for those who want to understand the overall architecture of their projects.
578+
Architecture Diagrams can be generated from text prompts using tools like Mermaid.js integrated with LLMs:
577579

578580
<div style="padding:56.25% 0 0 0;position:relative;"><iframe src="https://player.vimeo.com/video/1120819061?h=c364063439&amp;badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479" frameborder="0" allow="autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media; web-share" referrerpolicy="strict-origin-when-cross-origin" style="position:absolute;top:0;left:0;width:100%;height:100%;" title="How to use mermaid with librechat for creating diagrams ?"></iframe></div>
579581

580582
### Documentation generation
581583

582-
Documentation generation is a prompt engineering technique that involves providing a documentation for a given code snippet or function. This technique is useful for developers who want to document their code or for those who want to provide documentation for their projects. It can be used to generate documentation in various formats such as Markdown, HTML, or PDF.
584+
LLM, in particular when combined with RAG and Agentic AI techniques, can be used to generate documentation for various codes, from snippets to entire projects. This documentation can be generated in various formats such as Markdown, HTML, or PDF.
583585

584-
### Commit Message Generation
586+
`Generate a README.md file for installing and using the following project, based on the commands found in the linked `pom.xml` file`
585587

586-
Commit message generation is a prompt engineering technique that involves providing a commit message for a given code snippet or function. This technique is useful for developers who want to generate commit messages for their code or for those who want to ensure that their commit messages are clear and concise.
588+
`Analyze the API endpoints in `api` folder and generate API documentation in Markdown format`
587589

588590
### Vulnerability checking
589591

590-
Vulnerability checking is a prompt engineering technique that involves providing a vulnerability check for a given code snippet or function. This technique is useful for developers who want to check for vulnerabilities in their code or for those who want to ensure that their code is secure.
592+
`Analyze the following code for potential security vulnerabilities and suggest improvements`
591593

592594
::: warning
593-
This prompt is not recommended for production use. It is intended for testing and debugging purposes only and is not a proof of security or safety of your app.
595+
This is not recommended for production use. It is intended for testing and debugging purposes only and is not a proof of security or safety of your app.
594596
:::
595597

596598
### Shell/CLI commands manual
597599

598600
As a developer, you’re not limited to only writing code. LLMs can assist with CLI such as shell commands and version control using Git.
599601

602+
`Move all .txt files from the current directory to a folder named 'docs'`
603+
604+
`Create a new Git branch named 'feature-x' and switch to it`
605+
600606
### Regular expression explanation
601607

602-
You can understand complex regular expressions and generate ones that match specific patterns in text. This technique is useful for developers who want to write complex regular expressions or for those who want to understand the syntax of regular expressions.
608+
Ask LLM to help you understand complex regular expressions or generate ones that match specific patterns in text.
603609

604-
```
605-
Explain this regular expression in JavaScript: const regex =
606-
/^[A-Za-z0–9._%+-]+@[A-Za-z0–9.-]+\\.[A-Za-z]{2,}$/;
607-
```
610+
`Explain this regular expression in JavaScript: const regex = /^[A-Za-z0–9._%+-]+@[A-Za-z0–9.-]+\\.[A-Za-z]{2,}$/;`
611+
612+
`Generate a Perl regular expression that matches US phone numbers in the format (123) 456-7890`

docs/src/3.client/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ You can use the APIs to generate responses from the models. To enable the API se
235235
2024-11-15 18:45:22 [INFO] [LM STUDIO SERVER] Supported endpoints:
236236
2024-11-15 18:45:22 [INFO] [LM STUDIO SERVER] -> GET http://localhost:1234/v1/models
237237
2024-11-15 18:45:22 [INFO] [LM STUDIO SERVER] -> POST http://localhost:1234/v1/chat/completions
238-
2024-11-15 18:45:22 [INFO] [LM STUDIO SERVER] -> POST http://localhost:1234/v1/completions
239238
2024-11-15 18:45:22 [INFO] [LM STUDIO SERVER] -> POST http://localhost:1234/v1/embeddings
240239
2024-11-15 18:45:22 [INFO]
241240
2024-11-15 18:45:22 [INFO] [LM STUDIO SERVER] Logs are saved into /Users/ibrahim/.cache/lm-studio/server-logs
@@ -247,7 +246,6 @@ You can use the endpoints to generate responses from the models. The endpoints a
247246

248247
- `GET /v1/models`: This endpoint returns a list of the available models.
249248
- `POST /v1/chat/completions`: This endpoint generates responses from the models using the chat format.Chat format is used for tasks such as chatbots, conversational AI, and language learning.
250-
- `POST /v1/completions`: This endpoint generates responses from the models using the completion format. Completion format is used for tasks such as question answering, summarization, and text generation.
251249
- `POST /v1/embeddings`: This endpoint generates embeddings from the models. Embeddings are used for tasks such as sentiment analysis, text classification, and language translation.
252250

253251

docs/src/4.assistant/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ Copilot chat is available as an extension for VSCode. You can install it from th
6565

6666
![copilot-assistance2](../assets/images/copilot_assistance2.gif)
6767

68+
#### Generate commit message
69+
70+
![copilot-commit](../assets/images/copilot_commit.gif)
71+
6872
#### Test generation
6973

7074
![copilot-test](../assets/images/copilot_testing.gif)

docs/src/5.services/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,16 @@ OpenAI provides a set of standard endpoints for interacting with their LLMs. Thi
7777
| **Retrieve Model**<br>Get details of a specific model | GET `/v1/models/{model}` | `Authorization: Bearer {api_key}` || `{ "id": "gpt-4", "object": "model", "owned_by": "openai", "permission": [...], "created": 1234567890 }` |
7878
| **Chat Completions**<br>Generate chat-based responses | POST `/v1/chat/completions` | `Authorization: Bearer {api_key}`<br>`Content-Type: application/json` | `{ "model": "gpt-4", "messages": [{"role": "system", "content": "..."}, {"role": "user", "content": "..."}], "temperature": 0.7, "max_tokens": 100, "top_p": 1 }` | `{ "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1234567890, "model": "gpt-4", "choices": [{ "index": 0, "message": {"role": "assistant", "content": "..."}, "finish_reason": "stop" }], "usage": { "prompt_tokens": 10, "completion_tokens": 20, "total_tokens": 30 } }` |
7979
| **Embeddings**<br>Generate vector embeddings for text | POST `/v1/embeddings` | `Authorization: Bearer {api_key}`<br>`Content-Type: application/json` | `{ "model": "text-embedding-3-small", "input": "Hello world", "encoding_format": "float" }` | `{ "object": "list", "data": [{ "object": "embedding", "embedding": [0.123, -0.456, ...], "index": 0 }], "model": "text-embedding-3-small", "usage": { "prompt_tokens": 3, "total_tokens": 3 } }` |
80-
| **Completions (Legacy)**<br>Generate text completions | POST `/v1/completions` | `Authorization: Bearer {api_key}`<br>`Content-Type: application/json` | `{ "model": "gpt-3.5-turbo-instruct", "prompt": "Once upon a time", "max_tokens": 100, "temperature": 0.7 }` | `{ "id": "cmpl-abc123", "object": "text_completion", "created": 1234567890, "model": "gpt-3.5-turbo-instruct", "choices": [{ "text": "...", "index": 0, "finish_reason": "stop", "logprobs": null }], "usage": { "prompt_tokens": 5, "completion_tokens": 20, "total_tokens": 25 } }` |
81-
8280

8381
API references for Mistral AI :
8482
- [Chat Endpoints - GET](https://docs.mistral.ai/api/#tag/models/operation/list_models_v1_models_get)
8583
- [Chat Endpoints - POST](https://docs.mistral.ai/api/#tag/chat/operation/chat_completion_v1_chat_completions_post)
8684

8785

86+
You can test these endpoints here:
87+
88+
<RestLlmTester />
89+
8890
#### Structured Outputs
8991

9092
[`Structured Outputs`](https://platform.openai.com/docs/guides/structured-outputs) is a feature that ensures the model will always generate responses that adhere to your supplied [JSON Schema](https://platform.openai.com/docs/api-reference/chat/create#chat_create-response_format), so you don't need to worry about the model omitting a required key, or hallucinating an invalid enum value.

0 commit comments

Comments
 (0)