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

fix open debug playground #93

Merged
merged 10 commits into from
Jul 25, 2024
Merged

fix open debug playground #93

merged 10 commits into from
Jul 25, 2024

Conversation

constantinidan
Copy link
Contributor

@constantinidan constantinidan commented Jul 24, 2024

Copy link

linear bot commented Jul 24, 2024

ENG-1698 fix langchain callback when linking prompt

def process_content(content: Any) -> Tuple[Dict, Optional[str]]:
    if content is None:
        return {}, None
    if isinstance(content, dict):
        return content, "json"
    elif isinstance(content, str):
        return {"content": content}, "text"
    else:
        return {"content": str(content)}, "text"

image.png

=> FIX

def process_content(content: Any) -> Tuple[Dict, Optional[str]]:
    if content is None:
        return {}, None
    if isinstance(content, dict):
        return content, "json"
    elif isinstance(content, str):
        return content
    else:
        return {"content": str(content)}, "text"

image.png

@willydouhard
Copy link
Contributor

You should run the precommit locally to make sure the formatting/type checking is passing @constantinidan

@desaxce
Copy link
Contributor

desaxce commented Jul 25, 2024

I'd introduced a bug in #86.

So I added:

  • an LC example with tool calls + placeholders from CallDesk
  • an LC example with simple variable from Dan
  • the fix to process variable content

@willydouhard Did we use to have a Langchain example where we have a JSON-formatted variable?

Copy link
Contributor

@Dam-Buty Dam-Buty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one tiny comment

)
messages = prompt.to_langchain_chat_prompt_template()

inp = messages.format_messages(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as this is an example, can you plz change to a more explicit variable name ?

@Dam-Buty Dam-Buty self-requested a review July 25, 2024 15:22
@desaxce desaxce merged commit c4c3d44 into main Jul 25, 2024
2 checks passed
@desaxce desaxce deleted the cd/ENG-1698 branch July 25, 2024 15:23
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

Successfully merging this pull request may close these issues.

4 participants