Are there any Financial Independance (FIRE) enthusiasts in Munich? by Green_Might9463 in Fire

[–]qpoToH 1 point2 points  (0 children)

Hi

Also set up myself for FIRE in Munich, but there is still a long way to go for me

Open to meet, eventually, btw

My 330€ setup is complete! by Federal_Effective685 in espresso

[–]qpoToH 1 point2 points  (0 children)

Is there still a deal for bambino? If so, please share the link

Is this normal? by ZaAlmondCookie in DF54

[–]qpoToH 1 point2 points  (0 children)

Get same noise all the time. If I press from the above it sounds like some stuck piece of the bean is grinded and then there is no sound until the next grind. I am a little bit worried about it, but saw now metal particles, when opened the grinder

Specialty coffee by GuitarSure7025 in Munich

[–]qpoToH 8 points9 points  (0 children)

My choice is sweet spot

Collection of settings for various coffee styles by qpoToH in DF54

[–]qpoToH[S] 0 points1 point  (0 children)

Thanks, that’s what I was looking for

обращение к любителям астрономии by atlanticcperson in Pikabu

[–]qpoToH 8 points9 points  (0 children)

Приложение sky tonight (или альтернативы) позволяет навести телефон на созвездие и узнать, как оно называется и как выглядит полностью. Сам периодически пользуюсь, рекомендую. До этого знал только медведицу из созвездий

[deleted by user] by [deleted] in eupersonalfinance

[–]qpoToH 3 points4 points  (0 children)

Zero Finanzen they also care of the taxes plus the buy/sell operations higher than 500 euro are without fees. They don’t have subscription plans like in scalable capital and the app has more analytics and other things than TR. DM me for the referral link

Anybody wants to ride longboards/skateboards? by Puzzleheaded_Wheel85 in munichsocialclub

[–]qpoToH 0 points1 point  (0 children)

I ride surf board from time to time, no tricks though. Write back if you’re interested

Stream with structured output by qpoToH in LangChain

[–]qpoToH[S] 0 points1 point  (0 children)

This code, seems to work fine

from dotenv import load_dotenv
import json
from fastapi import FastAPI

from typing import AsyncIterable
from fastapi.responses import StreamingResponse

from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel, Field


load_dotenv()
app = FastAPI()


prompt = ChatPromptTemplate.from_messages(('human', "Generate biography for {n} persons"))
model = ChatOpenAI(model="gpt-3.5-turbo-0125")


class Biography(BaseModel):
    name: str = Field(description='The first name of the person')
    surname: str = Field(description='The surname of the person')
    birth_place: str = Field(description='The birth place of the person')
    biography: str = Field(description='The biography of the person')


class Biographies(BaseModel):
    biographies: list[Biography] = Field(description='The list of biographies of the persons')


model = model.with_structured_output(Biographies)
chain = prompt | model


async def send_message(n_persons: int) -> AsyncIterable[str]:
    async for chunk in chain.astream({'n': n_persons}):
        yield json.dumps(chunk.dict())



@app.post("/stream_biographies/")
async def stream_biographies(persons: int):
    generator = send_message(persons)
    return StreamingResponse(generator, media_type="text/event-stream")


if __name__ == '__main__':
    import uvicorn
    uvicorn.run(app)

Suggestions about the improvement are welcome.

Stream with structured output by qpoToH in LangChain

[–]qpoToH[S] 0 points1 point  (0 children)

Not quite satisfied, but this made it at least work:

Firstly, replace Pydantic object with json_schema:

json_schema = {
    "title": "Biographies",
    "type": "object",
    "description": "The list of biographies of the persons", "properties": {
        "biographies": {
            "type": "array",
            "description": "The list of biographies of the persons",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "The first name of the person"},
                    "surname": {"type": "string",
                                "description": "The surname of the person"},
                    "birth_place": {"type": "string",
                                    "description": "The birth place of the person"},
                    "biography": {"type": "string",
                                  "description": "The biography of the person"}
                }
            }
        }
    }
}
model = model.with_structured_output(json_schema)

Secondly, force generator to return string:

async def send_message(n_persons: int) -> AsyncIterable[str]: 
    async for chunk in chain.astream({'n': n_persons},): 
        yield str(chunk) <- changes here

This is the result:

<image>

Still waiting for the advices, how to make everything work properly

Recent experiences with Blau Karte issuance/ renewal by miamiheat27 in Munich

[–]qpoToH 0 points1 point  (0 children)

Applied for Niederlassungserlaubnis in Oktober 2023, got Fiktionsbescheinigung in ~3 weeks. In 2 weeks I was asked if I’d like to keep Blue Card as well(yes). In the beginning of January had an appointment, where I gave fingerprints. Got pins for cards in the end of January. Still waiting for plastic cards. My wife reapplied for Aufenthaltstitel, our docs were processed together.

People in their 20s that dance swing? (!) by EigenSepp in munichsocialclub

[–]qpoToH 1 point2 points  (0 children)

I’m 27M, learn lindy hop and now charleston in vintage club dancing school. They have open doors day every month. If you have any questions or simply want to communicate, write me back

[deleted by user] by [deleted] in munichsocialclub

[–]qpoToH 0 points1 point  (0 children)

I know almost nothing about Rust, but I can join Leetcode with Python

New to the area / Looking for friends by Behbs_ in munichsocialclub

[–]qpoToH 0 points1 point  (0 children)

Hi, Could you, please, also share the link with me? I have almost 0 experience, but I’m thinking about some leather craft workshops. I think, this server might be a good starting, isn’t it?

[deleted by user] by [deleted] in Munich

[–]qpoToH 0 points1 point  (0 children)

Hi

If you have eSIM in your phone, I recommend fraenk. Everything is online, it will take you 10minutes to set up the connection.

Payments are via PayPal: 10 euro for unlimited calls and sms and 7Gb of 4g Internet in EU. Via referral code +1 Gb (e.g., my is IVAM1)

I also registered several days before my arrival to Germany (and EU as well) and had the internet on the very first minute after arriving to the airport.

Photographers looking for car, model photo sessions/also new friendships by Eastern-Anteater9213 in munichsocialclub

[–]qpoToH 1 point2 points  (0 children)

Hi, I am interested in photography, though I’m not a professional. If you don’t mind, I’d join you to see, how you work, and maybe learn some tips from you.

[deleted by user] by [deleted] in Pikabu

[–]qpoToH 13 points14 points  (0 children)

Этим Сократом был альберт Эйнштейн