You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+82-16Lines changed: 82 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,70 @@
1
1
# OpenHosta
2
-
v2.2.2 - Open-Source Project
3
2
4
-
<ahref="https://colab.research.google.com/github/hand-e-fr/OpenHosta/blob/main/docs/openhosta_mistral_small.ipynb"target="_parent"><imgsrc="https://colab.research.google.com/assets/colab-badge.svg"alt="Open In Colab"/> Basic Usage - local LLM (Mistral-Small-2501)</a>
5
-
<br/>
6
-
<ahref="https://colab.research.google.com/github/hand-e-fr/OpenHosta/blob/main/docs/openhosta_phi4.ipynb"target="_parent"><imgsrc="https://colab.research.google.com/assets/colab-badge.svg"alt="Open In Colab"/> Basic Usage - Synthetic Data - local LLM (phi-4)</a>
7
-
<br/>
8
-
<ahref="https://colab.research.google.com/github/hand-e-fr/OpenHosta/blob/main/docs/openhosta_agent.ipynb"target="_parent"><imgsrc="https://colab.research.google.com/assets/colab-badge.svg"alt="Open In Colab"/> Simple AI Agent with gpt-4o</a>
9
-
<br/>Or have a look at [regression tests files](https://github.com/hand-e-fr/OpenHosta/tree/main/tests/non-regression) for multiples exemples.
3
+
v3.0.0 - Integrates Inria Comments
10
4
11
-
OpenHosta is a powerful Python tool designed to seamlessly integrate Large Language Models (LLMs) into development environments, enabling AI-powered function emulation that maintains native Python syntax and paradigms. Its strength lies in its simplicity and flexibility, allowing developers to easily create AI-enhanced applications while maintaining clean, Pythonic code structure.
5
+
<br/>You can read the doc or directly have a look at [tests files](https://github.com/hand-e-fr/OpenHosta/tree/main/tests/) for multiples exemples.
12
6
13
-
**- The future of development is human -**
7
+
OpenHosta is a powerful Python extension designed to seamlessly integrate semantic capabilities seen in Large Language Models (LLMs) into tradictional development environments, enabling AI-powered function emulation that maintains native Python syntax and paradigms. Its strength lies in its simplicity and flexibility, allowing developers to easily create AI-enhanced applications while maintaining clean, Pythonic code structure.
8
+
9
+
OpenHosta can run fully offline with a local model, or use a remote model via API key.
14
10
15
-
Welcome to the OpenHosta documentation, a powerful tool that facilitates the integration LLM in the development environnement. OpenHosta is used to emulate functions using AI, while respecting Python's native paradygma and syntax.
11
+
**- The future of development is human -**
16
12
17
13
For this project, we have adopted a [Code of Conduct](https://github.com/hand-e-fr/OpenHosta/blob/main/CODE_OF_CONDUCT.md) to ensure a respectful and inclusive environment for all contributors. Please take a moment to read it.
18
14
15
+
The simplest usage of OpenHosta is to allow semantic tests in your code, like this:
16
+
17
+
```python
18
+
from OpenHosta import test
19
+
20
+
sentence ="You are an nice person."
21
+
# You shall try with this too:
22
+
# sentence = "You are a stupid #@!!~uk."
23
+
24
+
if test(f"this contains an insult: {sentence}"):
25
+
print("The sentence is considered an insult.")
26
+
else:
27
+
print("The sentence is not considered an insult.")
28
+
29
+
# The sentence is not considered an insult.
30
+
```
31
+
32
+
But the most powerful feature of OpenHosta is the `emulate` function, which allows you to define a function with a docstring and let OpenHosta implement it for you using AI. The `emulate` function supports basic python types, dataclasses, pydantic, enums and Images. You can use all these types as input and output of the function (except for Images which can only be input).
33
+
34
+
```python
35
+
from OpenHosta import emulate
36
+
37
+
from enum import Enum
38
+
classDocumentType(Enum):
39
+
OLD_BOOK="old_book"
40
+
ARTICLE="article"
41
+
REPORT="report"
42
+
THESIS="thesis"
43
+
44
+
fromPIL.Image import Image, open
45
+
46
+
defclassify_document(page:Image)->DocumentType:
47
+
"""
48
+
This function classifies the document based on the content of the page givent in parameter.
0 commit comments