Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.

Commit 477a16c

Browse files
authored
Merge pull request #1 from gsilva2016/main
v1.0.0
2 parents b6ea419 + efa849a commit 477a16c

Some content is hidden

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

62 files changed

+3621
-0
lines changed

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
## Pull requests
2+
3+
Please adhere to the coding conventions used throughout the project. If in doubt, consult the
4+
[Effective Go](https://golang.org/doc/effective_go.html) style guide.
5+
6+
Adhering to the following process is the best way to get your work included in the project:
7+
8+
1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, and configure
9+
the remotes:
10+
11+
```bash
12+
# Clone your fork of the repo into the current directory
13+
git clone https://github.com/intel-samples/langchain-samples.git
14+
15+
# Navigate to the newly cloned directory
16+
cd langchain-samples
17+
18+
# Assign the original repo to a remote called "upstream"
19+
git remote add upstream https://github.com/intel-samples/langchain-samples.git
20+
```
21+
22+
2. If you cloned a while ago, get the latest changes from upstream:
23+
24+
```bash
25+
git checkout main
26+
git pull --rebase upstream main
27+
```
28+
29+
3. Create a new issue branch from `main` using the naming convention `I-[issue-number]` to
30+
help us keep track of your contribution scope:
31+
32+
```bash
33+
git checkout -b I-[issue-number]
34+
```
35+
36+
4. Commit your changes in logical chunks. When you are ready to commit, make sure to write a Good
37+
Commit Message™ by consulting the [Commit Message Guidelines](#commit-message-guidelines) following the conventional commit standard.
38+
39+
40+
Note that every commit you make must be signed. By signing off your work you indicate that you
41+
are accepting the [Developer Certificate of Origin](https://developercertificate.org/).
42+
43+
Use your real name (sorry, no pseudonyms or anonymous contributions). If you set your `user.name`
44+
and `user.email` git configs, you can sign your commit automatically with `git commit -s`.
45+
46+
5. Locally merge (or rebase) the upstream development branch into your issue branch:
47+
48+
```bash
49+
git pull --rebase upstream main
50+
```
51+
52+
6. Push your issue branch up to your fork:
53+
54+
```bash
55+
git push origin I-[issue-number]
56+
```
57+
58+
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title
59+
and detailed description.
60+
61+
## Pull Requests practices
62+
63+
* PR author is responsible to merge its own PR after review has been done and CI has passed.
64+
* When merging, make sure git linear history is preserved. PR author should select a merge option (`Rebase and merge` or `Squash and merge`) based on which option will fit the best to the git linear history.
65+
* PR topic should follow the same guidelines as the header of the [Git Commit Message](#commit-message-format)
66+
67+
## <a name="commit"></a> Commit Message Guidelines
68+
69+
The git commit messages for this project follow the conventional commit format guideline. This leads to more readable messages that are easy to follow when looking through the project history.
70+
71+
### Commit Message Format
72+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**:
73+
74+
```
75+
<type>(<scope>): <subject>
76+
<BLANK LINE>
77+
<body>
78+
<BLANK LINE>
79+
<footer>
80+
```
81+
82+
The **header** with **type** is mandatory. The **scope** of the header is optional as far as the automated PR checks are concerned, but be advised that PR reviewers **may request** you provide an applicable scope.
83+
84+
Any line of the commit message should not be longer 72 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
85+
86+
The footer should contain a reference to an Azure Boards ticket (e.g. AB#[number]).
87+
88+
Example 1:
89+
```
90+
feat(telemetry): Add new MQTT events
91+
92+
Events are now emitted over various /mps topics on MQTT for success/failures
93+
as they occur throughout the service.
94+
95+
Resolves: AB#2222
96+
```
97+
98+
99+
### Revert
100+
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
101+
102+
### Type
103+
104+
Must be one of the following:
105+
106+
* **feat**: A new feature
107+
* **fix**: A bug fix
108+
* **docs**: Documentation only changes
109+
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, etc)
110+
* **refactor**: A code change that neither fixes a bug nor adds a feature
111+
* **perf**: A code change that improves performance
112+
* **test**: Adding missing tests or correcting existing tests
113+
* **build**: Changes that affect the CI/CD pipeline or build system or external dependencies (example scopes: travis, jenkins, makefile)
114+
* **ci**: Changes provided by DevOps for CI purposes.
115+
* **revert**: Reverts a previous commit.
116+
117+
### Scope
118+
119+
Should be one of the following:
120+
Modules:
121+
* **cli**: A change or addition to application interface
122+
* **config**: A change or addition to service configuration
123+
* **deps**: A change or addition to dependencies (primarily used by dependabot)
124+
* **deps-dev**: A change or addition to developer dependencies (primarily used by dependabot)
125+
* **docker**: A change or addition to docker file or composition
126+
* **gh-actions**: A change or addition to GitHub actions
127+
* **heci**: A change or addition to heci functionality
128+
* **lib**: A change or addition that affects RPC built as a library
129+
* **lme**: A change or addition to local management engine functionality
130+
* **lms**: A change or addition to local management service functionality
131+
* **lmx**: A change or addition to both lme and lms functionality
132+
* **pthi**: A change or addition to pthi functionality
133+
* **rps**: A change or addition to interactions with Remote Provisioning Server
134+
* **sample**: A change or addition to the sample application
135+
* **utils**: A change or addition to the utility functions
136+
* *no scope*: If no scope is provided, it is assumed the PR does not apply to the above scopes
137+
138+
### Body
139+
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
140+
Here is detailed guideline on how to write the body of the commit message ([Reference](https://chris.beams.io/posts/git-commit/)):
141+
```
142+
More detailed explanatory text, if necessary. Wrap it to about 72
143+
characters or so. In some contexts, the first line is treated as the
144+
subject of the commit and the rest of the text as the body. The
145+
blank line separating the summary from the body is critical (unless
146+
you omit the body entirely); various tools like `log`, `shortlog`
147+
and `rebase` can get confused if you run the two together.
148+
149+
Explain the problem that this commit is solving. Focus on why you
150+
are making this change as opposed to how (the code explains that).
151+
Are there side effects or other unintuitive consequences of this
152+
change? Here's the place to explain them.
153+
154+
Further paragraphs come after blank lines.
155+
156+
- Bullet points are okay, too
157+
158+
- Typically a hyphen or asterisk is used for the bullet, preceded
159+
by a single space, with blank lines in between, but conventions
160+
vary here
161+
```
162+
163+
### Footer
164+
165+
The footer should contain a reference to JIRA ticket (e.g. SL6-0000) that this commit **Closes** or **Resolves**.
166+
The footer should contain any information about **Breaking Changes**.
167+
168+
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Intel Corporation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# LangChain* - Intel® GenAI Reference Samples
2+
3+
Various Intel® hardware and LangChain based examples are provided. Different parts of the workload can be distributed across edge, on-prem, or a CSP devices/infrastructure.
4+
5+
| Demo | Description |
6+
| ------------- | ------------- |
7+
| [chapterization](chapterization) | Demonstrates an pipeline which automatically chapterizes long text/content from a provided audio context. The primary components utilize OpenVINO™ in LangChain* for audio-speech-recognition, embeddings generation, K-means clustering, and LLM chapterization. |
8+
| [qna](qna) | Demonstrates a pipeline which performs QnA using audio or text with RAG. The primary components utilize OpenVINO™ in LangChain for audio-speech-recognition, LLM text generation/response, and text-to-speech. |
9+
| [video-summarization](video-summarization) | Summarize Videos Using OpenVINO-GenAI, Langchain, and MiniCPM-V-2_6. |
10+
| [eval-text-summarization-benchmarking](genai-eval-text-summarization-benchmarking) | Perform a qualitative assessment of a candidate summarization by comparing it to a reference response. Metrics calculated are BLEU, ROUGE-N, and BERTScore |
11+
12+
<b>Note:</b> Please refer to following [guide](https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2023-0/gpu-disable-hangcheck.html) for disabling GPU hangchecks.
13+
14+
<b>FFmpeg</b>
15+
16+
FFmpeg is an open source project licensed under LGPL and GPL. See https://www.ffmpeg.org/legal.html. You are solely responsible for determining if your use of FFmpeg requires any additional licenses. Intel is not responsible for obtaining any such licenses, nor liable for any licensing fees due, in connection with your use of FFmpeg.
17+
18+
<b>AI Model Usage</b>
19+
20+
This repository utilizes various AI models, including fully open-source models (e.g., Apache 2.0, MIT-licensed models) and openly available models (e.g., Meta’s LLaMA). Each model remains the intellectual property of its respective creators and is governed by its original license. Fully open-source models such as Qwen, Mistral, and Phi allow unrestricted use, modification, and distribution under their respective licenses. Models like LLaMA are available under specific usage terms that may include restrictions. This document does not redistribute, modify, or alter any model weights, nor does it claim ownership over them. Users should consult the official licensing terms of each model before use. The inclusion of specific models in this whitepaper does not imply endorsement by their respective developers. The recommendations presented are based on independent research and do not constitute official guidance from Meta, OpenAI, Google, or any other model provider.

SECURITY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Security Policy
2+
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation.
3+
4+
## Reporting a Vulnerability
5+
Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).

chapterization/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Chapterization
2+
Demonstrates a pipeline which automatically chapterizes long text/content from a provided audio context. The primary components utilize OpenVINO™ in LangChain* for audio-speech-recognition, embeddings generation, K-means clustering, and LLM chapterization.
3+
4+
## Installation
5+
6+
Get started by running the below command.
7+
8+
```
9+
./install.sh
10+
```
11+
12+
Note: if this script has already been performed and you'd like to re-install the sample project only then the below command can be used to skip the re-install of dependencies.
13+
14+
```
15+
./install.sh --skip
16+
```
17+
18+
## Run Examples
19+
20+
Run the below command to start the demo with the following defaults:
21+
22+
LLM Model: llmware/llama-3.2-3b-instruct-ov<br>
23+
LLM batch-size: 2<br>
24+
ASR Model: distil-whisper/distil-small.en<br>
25+
ASR load in 8bit: True<br>
26+
ASR batch-size: 8<br>
27+
Inference Device: GPU<br>
28+
K-Means Clustering Enabled For Text : True<br>
29+
30+
```
31+
export LLM_MODEL=llmware/llama-3.2-3b-instruct-ov
32+
export LLM_BATCH_SIZE=2
33+
export ASR_MODEL=distil-whisper/distil-small.en
34+
export ASR_LOAD_IN_8BIT=1
35+
export ASR_BATCH_SIZE=8
36+
export INF_DEVICE=GPU
37+
export ENABLE_KMEANS=1
38+
./run-demo.sh audio.mp3
39+
```

chapterization/activate-conda.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
activate_conda(){
4+
CONDA_DIR=$HOME/miniforge3
5+
eval "$(${CONDA_DIR}/bin/conda shell.bash hook 2> /dev/null)"
6+
}

0 commit comments

Comments
 (0)