semvec/pypi-packages huggingface dataset:
langchain-localai 1.0.0
An integration package connecting LocalAI and LangChain
License: MIT
Requires Python: <4.0,>=3.10

# langchain-localai

This package contains the LangChain integration with LocalAI

## Installation

```bash
pip install -U langchain-localai
```

## Embeddings

`LocalAIEmbeddings` class exposes embeddings from LocalAI.

```python
from langchain_localai import LocalAIEmbeddings

embeddings = LocalAIEmbeddings(
    openai_api_base="http://localhost:8080",
    model="embedding-model-name")
embeddings.embed_query("What is the meaning of life?")
```

## Reranker

`LocalAIRerank` class exposes reranker from LocalAI.

```python
from langchain_localai import LocalAIRerank
from langchain_core.documents import Document

reranker = LocalAIRerank(
        openai_api_key="foo",
        model="bge-reranker-v2-m3",
        openai_api_base="http://localhost:8080",
    )
reranked_docs = reranker.compress_documents(documents=[
    Document(page_content="bar"),Document(page_content="baz")], query="foo")
samsung-widgets 0.3.0
Samsung-themed widgets for CustomTkinter
License: MIT

# 1. Set up your environment

pip install customtkinter

or

pip install customtkinter --break-system-packages



# 2. Basic imports and setup

import customtkinter as ctk
from samsung_widgets import SamsungToggle, SamsungSlider, SamsungEntry, SamsungButton


ctk.set_appearance_mode("light")  # Light mode
ctk.set_default_color_theme("blue")  # Samsung-like blue accents

root = ctk.CTk()
root.geometry("400x500")
root.title("Samsung Widgets Demo")



# 3. Add a SamsungEntry(Text Input)

entry = SamsungEntry(root, placeholder="Enter your name...")
entry.pack(pady=20)


def show_entry_text():
    print("Text in entry:", entry.get())

button_entry = SamsungButton(root, text="Show Text", command=show_entry_text)
button_entry.pack(pady=10)



# 4. Add a SamsungToggle

def toggle_action(state):
    print("Toggle state:", state)

toggle = SamsungToggle(root, command=toggle_action)
toggle.pack(pady=20)



# 5. Add a SamsungSlider

def slider_action(value):
    print("Slider value:", int(value))

slider = SamsungSlider(root, from_=0, to=100, command=slider_action, initial=50)
slider.pack(pady=20)



# 6. Add a SamsungButton

def button_click():
    print("Button clicked!")

button = SamsungButton(root, text="Click Me", command=button_click)
button.pack(pady=20)



# 7. Add a SamsungCheckBox()

def checkbox_action(state):
    print("Checked:", state)

checkbox = SamsungCheckBox(root, text="Enable Wi-Fi", command=checkbox_action)
checkbox.pack(pady=20)



# 8. Add a SamsungLable()

label = SamsungLabel(root, text="Samsung UI Label", size=16)
label.pack(pady=10)



# 9. Runthe application

root.mainloop()



# Tips

entry.get()       # Text input
toggle.state      # True/False
slider.value      # Current slider value
kaenova-prompty 20251102.15.9
Python SDK for Prompty - Real-time prompt management for AI agents
License: MIT
Requires Python: >=3.7
Keywords: prompty, ai, prompt, management, sdk

# Prompty Python SDK

Python client for interacting with the Prompty API to fetch real-time prompts for AI agents.

## Installation

```bash
pip install prompty-sdk
```

Or install from source:

```bash
cd python-sdk
pip install -e .
```

## Usage

```python
from prompty import PromptyClient

# Initialize the client
client = PromptyClient(
    base_url='https://your-prompty-instance.com',
    project_id='your-project-id',
    api_key='pk_your_api_key_here'
)

# Get the active prompt for an agent
prompt = client.get_prompt('customer-support-agent')
print(prompt)
# Output: "You are a helpful customer support assistant..."

# Get detailed information about the prompt
details = client.get_prompt_details('customer-support-agent')
print(details['prompt_text'])
print(details['prompt_id'])
print(details['updated_at'])
```

## API Reference

### PromptyClient

Initialize a Prompty client.

**Parameters:**
- `base_url` (str): The base URL of your Prompty instance
- `project_id` (str): Your project ID
- `api_key` (str): Your API key

### get_prompt(agent_name)

Get the active prompt text for an agent.

**Parameters:**
- `agent_name` (str): The name of the agent

**Returns:**
- `str`: The prompt text

**Raises:**
- `ValueError`: If the API key is invalid or agent not found
- `RuntimeError`: If there's a server error

### get_prompt_details(agent_name)

Get detailed information about the active prompt.

**Parameters:**
- `agent_name` (str): The name of the agent

**Returns:**
- `dict`: Dictionary containing:
  - `prompt_text` (str): The prompt text
  - `prompt_id` (str): The prompt ID
  - `updated_at` (str): When the prompt was created/updated
  - `agent_name` (str): The agent name

**Raises:**
- `ValueError`: If the API key is invalid or agent not found
- `RuntimeError`: If there's a server error

## Example: Using with OpenAI

```python
from prompty import PromptyClient
import openai

# Initialize Prompty client
prompty = PromptyClient(
    base_url='https://your-prompty-instance.com',
    project_id='your-project-id',
    api_key='pk_your_api_key_here'
)

# Get the prompt from Prompty
system_prompt = prompty.get_prompt('customer-support-agent')

# Use it with OpenAI
response = openai.ChatCompletion.create(
    model="gpt-4",
    messages=[
        {"role": "system", "content": system_prompt},
        {"role": "user", "content": "How do I reset my password?"}
    ]
)

print(response.choices[0].message.content)
```

## Error Handling

The SDK raises the following exceptions:

- `ValueError`: When the API key is invalid or the requested agent/prompt is not found
- `RuntimeError`: When there's a server error or network issue

```python
try:
    prompt = client.get_prompt('my-agent')
except ValueError as e:
    print(f"Invalid request: {e}")
except RuntimeError as e:
    print(f"Server error: {e}")
```

## License

MIT