Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code update in utils/main.py #406

Open
LarryStewart2022 opened this issue Jan 28, 2025 · 0 comments
Open

Code update in utils/main.py #406

LarryStewart2022 opened this issue Jan 28, 2025 · 0 comments

Comments

@LarryStewart2022
Copy link

I kept running into an list index out of range error when calling a function in my pipeline. (def get_weather(self, location_key: str) -> str:)
[DEBUG 9] pipeline name: Weather Pipeline [DEBUG 10] Number of messages: 1 [DEBUG 11] user_message extracted: hows the weather in troy mi list index out of range INFO: 127.0.0.1:58512 - "POST /weather/filter/inlet HTTP/1.1" 500 Internal Server Error

Also, I updated the main.py to also handle these silly issues

def doc_to_dict(docstring):
lines = docstring.split("\n")
if len(lines) < 2:
# Fallback: If there's only one line, treat that as your description
return {
"description": lines[0].strip() if lines else "",
"params": {}
}

description = lines[1].strip()

All is well now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant