Skip to content

Commit

Permalink
Merge pull request #1 from 0w9/main
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
0w9 authored May 28, 2023
2 parents 4e5ac74 + ab70247 commit 17bc7a3
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 1 addition & 2 deletions langchain_discord/webhook.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from typing import Optional
from langchain.callbacks.manager import CallbackManagerForToolRun
from langchain.tools import BaseTool
from pydantic import BaseModel, Field
from typing import Optional, Type
Expand Down Expand Up @@ -31,7 +30,7 @@ class DiscordWebhookTool(BaseTool):
## InFO: See above.
#args_schema: Type[DiscordWebhookInput] = DiscordWebhookInput

def _run(self, webhook_message: str, run_manager: Optional[CallbackManagerForToolRun] = None) -> str:
def _run(self, webhook_message: str) -> str:
if(os.environ.get("WEBHOOK_URL") is None): raise ValueError("WEBHOOK_URL environment variable not set")
if(os.environ.get("WEBHOOK_URL") is None): raise ValueError("WEBHOOK_URL environment variable not set")

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "langchain_discord"
version = "1.0.0"
version = "1.0.2"
authors = [
{ name="Lennard Dorst", email="[email protected]" },
]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
setup(
name = 'langchain_discord', # How you named your package folder (MyLib)
packages = ['langchain_discord'], # Chose the same as "name"
version = '1.0.0', # Start with a small number and increase it with every change you make
version = '1.0.2', # Start with a small number and increase it with every change you make
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
description = 'This package offers some easy-to-use tools to integrate Discord into LangChain for agents.', # Give a short description about your library
author = 'Lennard Dorst', # Type in your name
Expand Down

0 comments on commit 17bc7a3

Please sign in to comment.